File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
apps/desktop/src/lib/branch Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 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 );
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 >
Original file line number Diff line number Diff line change 126126 disabled ={! localBranch }
127127 onclick ={async () => {
128128 if (localBranch ) {
129- console .log (JSON .stringify (localBranch ));
130129 deleteBranchModal .show (branch );
131130 }
132131 }}
You can’t perform that action at this time.
0 commit comments