Browse Source

fix: avoid duplicate table create invoke on tab switch

closes #804

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/805/head
Pranav C 3 years ago
parent
commit
cbca1d7397
  1. 5
      packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue

5
packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue

@ -816,7 +816,7 @@ export default {
this.featureType = feat this.featureType = feat
}, },
async createTableIfNewTable() { async createTableIfNewTable() {
if (this.nodes.newTable) { if (this.nodes.newTable && !this.nodes.tableCreated) {
const columns = this.sqlUi.getNewTableColumns().filter(col => this.nodes.newTable.columns.includes(col.cn)) const columns = this.sqlUi.getNewTableColumns().filter(col => this.nodes.newTable.columns.includes(col.cn))
await this.$store.dispatch('sqlMgr/ActSqlOpPlus', [ await this.$store.dispatch('sqlMgr/ActSqlOpPlus', [
{ {
@ -834,7 +834,8 @@ export default {
...this.nodes ...this.nodes
} }
}) })
// delete this.nodes.newTable // eslint-disable-next-line vue/no-mutating-props
this.nodes.tableCreated = true
} }
this.loadViews = true this.loadViews = true

Loading…
Cancel
Save