Skip to content

Commit fc31c5e

Browse files
ndom91mtsgrd
authored andcommitted
fix: set branch delete modal action btn to loading=true when appropriate
1 parent 7a3b694 commit fc31c5e

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

apps/desktop/src/lib/branch/BranchLaneContextMenu.svelte

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
let aiConfigurationValid = $state(false);
3939
let newRemoteName = $state('');
4040
let allowRebasing = $state<boolean>();
41+
let loadingDelete = $state(false);
4142
4243
const branch = $derived($branchStore);
4344
const commits = $derived(branch.commits);
@@ -187,15 +188,20 @@
187188
title="Delete branch"
188189
bind:this={deleteBranchModal}
189190
onSubmit={async (close) => {
190-
await branchController.deleteBranch(branch.id);
191-
close();
191+
try {
192+
loadingDelete = true;
193+
await branchController.deleteBranch(branch.id);
194+
close();
195+
} finally {
196+
loadingDelete = false;
197+
}
192198
}}
193199
>
194200
{#snippet children(branch)}
195201
Are you sure you want to delete <code class="code-string">{branch.name}</code>?
196202
{/snippet}
197203
{#snippet controls(close)}
198204
<Button style="ghost" outline onclick={close}>Cancel</Button>
199-
<Button style="error" kind="solid" type="submit">Delete</Button>
205+
<Button style="error" kind="solid" type="submit" loading={loadingDelete}>Delete</Button>
200206
{/snippet}
201207
</Modal>

apps/desktop/src/lib/branch/BranchPreviewHeader.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@
126126
disabled={!localBranch}
127127
onclick={async () => {
128128
if (localBranch) {
129-
console.log(JSON.stringify(localBranch));
130129
deleteBranchModal.show(branch);
131130
}
132131
}}

0 commit comments

Comments
 (0)