From 02cfbd7878b20981016295126038477f6b2d0c9a Mon Sep 17 00:00:00 2001 From: Evan Morikawa Date: Sat, 5 Nov 2016 11:44:19 -0700 Subject: [PATCH] fix(plugin): use config since `activatePackage` doesn't persist --- src/package-manager.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/package-manager.coffee b/src/package-manager.coffee index 103710eb3..c4a4ef446 100644 --- a/src/package-manager.coffee +++ b/src/package-manager.coffee @@ -72,9 +72,11 @@ class PackageManager _onChangePluginState: (event, urlToOpen = "") => {query} = url.parse(urlToOpen, true) + disabled = NylasEnv.config.get('core.disabledPackages') ? [] for name, state of query - if state is "off" then @deactivatePackage(name) - else if state is "on" then @activatePackage(name) + if state is "off" and name not in disabled then disabled.push(name) + else if state is "on" then disabled = _.without(disabled, name) + NylasEnv.config.set('core.disabledPackages', disabled) _resolvePluginIdFor: (packageName, env) => metadata = @loadedPackages[packageName]?.metadata