fix(ui): PluginAdd tab check

This commit is contained in:
Guillaume Chau
2018-03-14 15:23:05 +01:00
parent 33b1e20556
commit ca01d957d6

View File

@@ -185,11 +185,7 @@ export default {
query: PLUGIN_INSTALLATION,
fetchPolicy: 'netork-only',
result () {
if (this.pluginInstallation.pluginId) {
this.tabId = 'config'
} else {
this.tabId = 'search'
}
this.checkTab()
},
}
},
@@ -203,6 +199,7 @@ export default {
mounted () {
requestAnimationFrame(() => {
this.$refs.searchInput.focus()
this.checkTab()
})
},
@@ -211,6 +208,16 @@ export default {
this.$router.push({ name: 'project-home' })
},
checkTab () {
if (!this.pluginInstallation) return
if (this.pluginInstallation.pluginId) {
this.tabId = 'config'
} else {
this.tabId = 'search'
}
},
async installPlugin () {
try {
await this.$apollo.mutate({