Skip to content

Commit

Permalink
fix(ui): clear client addons on PluginApi reset
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Jun 21, 2018
1 parent c2da5fc commit 3eb5116
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ function remove (id, context) {
if (index !== -1) addons.splice(index, 1)
}

function clear (context) {
for (const addon of addons) {
remove(addon.id, context)
}
}

function getUrl (addon, context) {
return addon.url || `${baseUrl}/_addon/${addon.id}/index.js`
}
Expand All @@ -64,5 +70,6 @@ module.exports = {
remove,
findOne,
getUrl,
serve
serve,
clear
}
1 change: 1 addition & 0 deletions packages/@vue/cli-ui/src/graphql-api/connectors/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ function resetPluginApi (context) {
}
sharedData.unWatchAll()

clientAddons.clear(context)
suggestions.clear(context)

pluginApi = new PluginApi({
Expand Down

0 comments on commit 3eb5116

Please sign in to comment.