diff --git a/packages/nc-gui/components/project/spreadsheet/components/sharedViewsList.vue b/packages/nc-gui/components/project/spreadsheet/components/sharedViewsList.vue index 8bde433018..e787eed433 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/sharedViewsList.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/sharedViewsList.vue @@ -65,9 +65,16 @@ export default { }, methods: { async loadSharedViewsList() { - this.viewsList = await this.$store.dispatch('sqlMgr/ActSqlOp', [{ dbAlias: this.nodes.dbAlias }, 'listSharedViewLinks', { + const viewsList = await this.$store.dispatch('sqlMgr/ActSqlOp', [{ dbAlias: this.nodes.dbAlias }, 'listSharedViewLinks', { model_name: this.modelName }]) + + const index = viewsList.findIndex(v => (v.view_name || '').toLowerCase() === (this.$route.query.view || '').toLowerCase()) + if (index > -1) { + viewsList.unshift(...viewsList.splice(index, 1)) + } + + this.viewsList = viewsList }, async deleteLink(id) { try { @@ -75,7 +82,7 @@ export default { id }]) this.$toast.success('Deleted shared view successfully').goAway(3000) - this.loadSharedViewsList() + await this.loadSharedViewsList() } catch (e) { this.$toast.error(e.message).goAway(3000) } @@ -85,7 +92,7 @@ export default {