fix(PostgreSQL): exception deleting a table with one or less tabs open

This commit is contained in:
Fabio Di Stasio 2023-12-28 10:44:11 +01:00
parent 0f8d2cb4ef
commit 23946ff2ce
1 changed files with 2 additions and 1 deletions

View File

@ -680,7 +680,8 @@ export const useWorkspacesStore = defineStore('workspaces', {
if (!isSelectedExistent && workspace.tabs.length) {
if (workspace.customizations.database) {
const databaseTabs = workspace.tabs.filter(tab => tab.type === 'query' || tab.database === workspace.database);
this.selectTab({ uid, tab: databaseTabs[databaseTabs.length - 1].uid });
if (databaseTabs.length)
this.selectTab({ uid, tab: databaseTabs[databaseTabs.length - 1].uid });
}
else
this.selectTab({ uid, tab: workspace.tabs[workspace.tabs.length - 1].uid });