fix(templates): Unregister preferences tab when disabled

This commit is contained in:
Ben Gotow 2015-12-07 17:23:59 -08:00
parent 30c58e90a6
commit 013d50a26b
2 changed files with 3 additions and 3 deletions

View file

@ -20,7 +20,7 @@ module.exports = {
deactivate() {
ComponentRegistry.unregister(TemplatePicker);
ComponentRegistry.unregister(TemplateStatusBar);
PreferencesUIStore.unregisterPreferencesTab(this.preferencesTab.sectionId);
PreferencesUIStore.unregisterPreferencesTab(this.preferencesTab.tabId);
ExtensionRegistry.Composer.unregister(TemplateComposerExtension);
},

View file

@ -56,8 +56,8 @@ class PreferencesUIStore extends NylasStore
@_selection = @_selection.set('tabId', tabItem.tabId)
@_triggerDebounced()
unregisterPreferencesTab: (tabId) ->
@_tabs = @_tabs.filter (s) => s.tabId isnt tabId
unregisterPreferencesTab: (tabItemOrId) ->
@_tabs = @_tabs.filter (s) -> s.tabId isnt tabItemOrId and s isnt tabItemOrId
@_triggerDebounced()
module.exports = new PreferencesUIStore()