Browse Source

fix: stay in same view even after view active name update

re #1653

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/1668/head
Pranav C 3 years ago
parent
commit
2445b181f9
  1. 29
      packages/nc-gui/components/project/spreadsheet/components/spreadsheetNavDrawer.vue

29
packages/nc-gui/components/project/spreadsheet/components/spreadsheetNavDrawer.vue

@ -767,22 +767,15 @@ export default {
return return
} }
try { try {
if (this.selectedViewIdLocal === view.id) { // if (this.selectedViewIdLocal === view.id) {
await this.$router.push({ // await this.$router.push({
query: { // query: {
...this.$route.query, // ...this.$route.query,
view: view.title_temp // view: view.title_temp
} // }
}) // })
} // }
this.$set(view, 'title', view.title_temp) this.$set(view, 'title', view.title_temp)
// await this.sqlOp({ dbAlias: this.nodes.dbAlias }, 'xcVirtualTableRename', {
// id: view.id,
// old_title: oldTitle,
// title: view.title_temp,
// alias: view.alias,
// parent_model_title: this.meta.table_name
// })
await this.$api.dbView.update(view.id, { await this.$api.dbView.update(view.id, {
title: view.title, title: view.title,
order: view.order order: view.order
@ -804,12 +797,6 @@ export default {
}, },
async deleteView(view) { async deleteView(view) {
try { try {
// await this.sqlOp({ dbAlias: this.nodes.dbAlias }, 'xcVirtualTableDelete', {
// id: view.id,
// title: view.alias || view.title,
// view_name: view.alias || view.title,
// parent_model_title: this.table
// })
await this.$api.dbView.delete(view.id) await this.$api.dbView.delete(view.id)
this.$toast.success('View deleted successfully').goAway(3000) this.$toast.success('View deleted successfully').goAway(3000)
await this.loadViews() await this.loadViews()

Loading…
Cancel
Save