Skip to content

Commit

Permalink
fix(PostgreSQL): exception deleting a table with one or less tabs open
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio286 committed Dec 28, 2023
1 parent 0f8d2cb commit 23946ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/renderer/stores/workspaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down

0 comments on commit 23946ff

Please sign in to comment.