/* globals Twitch, i18n */
import Component from 'ember-component';

export default Component.extend({
  // Passed-in
  playlistChannel: null,
  closeModal: null,

  actions: {
    stopPlaylist() {
      let playlistChannel = this.get('playlistChannel');
      playlistChannel.set('enabled', false);
      playlistChannel.save().catch(() => {
        Twitch.notify.error(i18n("Your playlist failed to update"));
      });

      this.get('closeModal')();
    }
  }
});
