From bbb1caefb4b7e0ad1004fd16eb057375721f8d90 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 4 Jan 2018 05:45:28 -0600 Subject: [PATCH] Always notify watchers of plugin updates (#2508) During plugin updates, each `plugin.onUnload` is invoked regardless of whether the plugin changed. This commit ensures that each `plugin.onApp` is invoked once all plugins have been updated. Fixes #2415. --- app/plugins.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/plugins.js b/app/plugins.js index b98e2f82..0be9d458 100644 --- a/app/plugins.js +++ b/app/plugins.js @@ -87,6 +87,8 @@ function updatePlugins({force = false} = {}) { cache.set('hyper.plugin-versions', pluginVersions); // notify watchers + watchers.forEach(fn => fn(err, {force})); + if (force || changed) { if (changed) { notify('Plugins Updated', 'Restart the app or hot-reload with "View" > "Reload" to enjoy the updates!'); @@ -94,7 +96,6 @@ function updatePlugins({force = false} = {}) { notify('Plugins Updated', 'No changes!'); } checkDeprecatedExtendKeymaps(); - watchers.forEach(fn => fn(err, {force})); } } });