Skip to content

Commit 4571bc2

Browse files
committed
Merge branch '590-infinite-loading-after-branch-destroy' into 'dle-4-0'
fix(ui): Infinite loading after branch destroy See merge request postgres-ai/database-lab!965
2 parents 63f50d4 + 0a6e51e commit 4571bc2

File tree

2 files changed

+6
-1
lines changed
  • ui/packages/shared/pages/Branches

2 files changed

+6
-1
lines changed

ui/packages/shared/pages/Branches/Branch/stores/Main.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export class MainStore {
9191
title: 'Error',
9292
message: `Branch "${branchId}" not found`,
9393
}
94+
this.isBranchesLoading = false
9495
}
9596

9697
return !!currentBranch
@@ -101,6 +102,10 @@ export class MainStore {
101102

102103
const { response, error } = await this.api.deleteBranch(branchName)
103104

105+
if (response) {
106+
this.branches =
107+
this.branches?.filter((branch) => branch.name !== branchName) || []
108+
}
104109

105110
return { response, error }
106111
}

ui/packages/shared/pages/Branches/components/Modals/DeleteBranchModal/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const DeleteBranchModal = ({
4444
if (deleteRes?.error) {
4545
setDeleteError(deleteRes.error?.message)
4646
} else {
47-
window.location.reload()
47+
window.location.replace('/instance/branches')
4848
}
4949
}
5050

0 commit comments

Comments
 (0)