import ChannelResource from '../../apiResources/deviceChannel';
import { canManageContent } from 'kolibri.coreVue.vuex.getters';

/**
 * Force-refresh the ChannelResource Collection
 *
 */
export function refreshChannelList(store) {
  store.dispatch('SET_CHANNEL_LIST_LOADING', true);
  return ChannelResource.getCollection()
    .fetch({ include_fields: 'on_device_file_size' }, true)
    .then(channels => {
      store.dispatch('SET_CHANNEL_LIST', [...channels]);
      store.dispatch('SET_CHANNEL_LIST_LOADING', false);
      return [...channels];
    });
}

export function showManageContentPage(store) {
  store.dispatch('RESET_MANAGE_CONTENT_PAGESTATE');
  if (canManageContent(store.state)) {
    return refreshChannelList(store);
  }
  return Promise.resolve();
}

export function setToolbarTitle(store, newTitle) {
  store.dispatch('SET_TOOLBAR_TITLE', newTitle);
}

@@ -4,127 +4,127 @@
 ort 
-ChannelResource from '../../apiResources/deviceChannel';%0Aimport %7B canManageContent %7D from 'kolibri.coreVue.vuex.getters
+%7B canManageContent %7D from 'kolibri.coreVue.vuex.getters';%0Aimport ChannelResource from '../../apiResources/deviceChannel
 ';%0A%0A

Fix linting.