Skip to content

Commit

Permalink
fix: fix foreign key constraint error when delete last tab (#9865)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shifan-Gu committed Apr 25, 2024
1 parent a838d89 commit 8265e7d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/frontend/src/components/DashboardTabs/index.tsx
Expand Up @@ -243,6 +243,9 @@ const DashboardTabs: FC<DashboardTabsProps> = ({
setDeletingTab(false);

if (dashboardTabs.length === 1) {
dashboardTiles?.forEach((tile) => {
tile.tabUuid = undefined; // set tab uuid back to null to avoid foreign key constraint error
});
return; // keep all tiles if its the last tab
}

Expand Down

0 comments on commit 8265e7d

Please sign in to comment.