fix(plugin): use config since activatePackage doesn't persist

This commit is contained in:
Evan Morikawa 2016-11-05 11:44:19 -07:00
parent ce05e94aeb
commit 02cfbd7878

View file

@ -72,9 +72,11 @@ class PackageManager
_onChangePluginState: (event, urlToOpen = "") => _onChangePluginState: (event, urlToOpen = "") =>
{query} = url.parse(urlToOpen, true) {query} = url.parse(urlToOpen, true)
disabled = NylasEnv.config.get('core.disabledPackages') ? []
for name, state of query for name, state of query
if state is "off" then @deactivatePackage(name) if state is "off" and name not in disabled then disabled.push(name)
else if state is "on" then @activatePackage(name) else if state is "on" then disabled = _.without(disabled, name)
NylasEnv.config.set('core.disabledPackages', disabled)
_resolvePluginIdFor: (packageName, env) => _resolvePluginIdFor: (packageName, env) =>
metadata = @loadedPackages[packageName]?.metadata metadata = @loadedPackages[packageName]?.metadata