Skip to content

Commit

Permalink
fix(ui): reload plugin api after plugin update
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Jun 10, 2018
1 parent 0ba3920 commit be3d538
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/@vue/cli-ui/src/graphql-api/connectors/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ async function initPrompts (id, context) {
await prompts.start()
}

function update (id, context, notify = true) {
function update (id, context, multi = false) {
return progress.wrap('plugin-update', context, async setProgress => {
setProgress({
status: 'plugin-update',
Expand All @@ -376,12 +376,13 @@ function update (id, context, notify = true) {
type: 'info'
}, context)

if (notify) {
if (!multi) {
notify({
title: `Plugin updated`,
message: `Plugin ${id} was successfully updated`,
icon: 'done'
})
resetPluginApi(context)
}

currentPluginId = null
Expand All @@ -395,7 +396,7 @@ async function updateAll (context) {
for (const plugin of plugins) {
const version = await getVersion(plugin, context)
if (version.current !== version.wanted) {
updatedPlugins.push(await update(plugin.id, context, false))
updatedPlugins.push(await update(plugin.id, context, true))
}
}

Expand All @@ -404,6 +405,7 @@ async function updateAll (context) {
message: `${updatedPlugins.length} plugin(s) were successfully updated`,
icon: 'done'
})
resetPluginApi(context)

return updatedPlugins
}
Expand Down

0 comments on commit be3d538

Please sign in to comment.