refactor: optimize tab reload on tab switch

re #767

Signed-off-by: Pranav C <pranavxc@gmail.com>
This commit is contained in:
Pranav C
2021-11-24 13:25:04 +05:30
parent 2bca2be339
commit 6358a4bc39
3 changed files with 13 additions and 3 deletions

View File

@@ -583,6 +583,7 @@ export default {
},
mixins: [spreadsheet],
props: {
isActive: Boolean,
tabId: String,
env: String,
nodes: Object,
@@ -670,6 +671,11 @@ export default {
rowContextMenu: null
}),
watch: {
isActive(n, o) {
if (!o && n) {
this.reload()
}
},
page(p) {
this.$store.commit('tabs/MutSetTabState', {
id: this.uniqueId,
@@ -1159,7 +1165,9 @@ export default {
}
},
computed: {
tabsState() { return this.$store.state.tabs.tabsState || {} },
tabsState() {
return this.$store.state.tabs.tabsState || {}
},
uniqueId() {
return `${this.tabId}_${this.selectedViewId}`
},