From 013d50a26bef2c40336bb481b1faa3da24805224 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Mon, 7 Dec 2015 17:23:59 -0800 Subject: [PATCH] fix(templates): Unregister preferences tab when disabled --- examples/N1-Composer-Templates/lib/main.es6 | 2 +- src/flux/stores/preferences-ui-store.coffee | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/N1-Composer-Templates/lib/main.es6 b/examples/N1-Composer-Templates/lib/main.es6 index f0fdf1626..53e81b51b 100644 --- a/examples/N1-Composer-Templates/lib/main.es6 +++ b/examples/N1-Composer-Templates/lib/main.es6 @@ -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); }, diff --git a/src/flux/stores/preferences-ui-store.coffee b/src/flux/stores/preferences-ui-store.coffee index a1cd7e367..c6220a508 100644 --- a/src/flux/stores/preferences-ui-store.coffee +++ b/src/flux/stores/preferences-ui-store.coffee @@ -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()