refactor: optimize tab reload on tab switch (re-submission)

Signed-off-by: Raju Udava <sivadstala@gmail.com>
This commit is contained in:
Raju Udava
2021-11-25 09:18:55 +05:30
parent d8b80ca6c4
commit cb620fcfd7
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,
@@ -1165,7 +1171,9 @@ export default {
}
},
computed: {
tabsState() { return this.$store.state.tabs.tabsState || {} },
tabsState() {
return this.$store.state.tabs.tabsState || {}
},
uniqueId() {
return `${this.tabId}_${this.selectedViewId}`
},