File tree Expand file tree Collapse file tree 1 file changed +24
-20
lines changed
Expand file tree Collapse file tree 1 file changed +24
-20
lines changed Original file line number Diff line number Diff line change @@ -181,28 +181,32 @@ export const MoveToAnotherBoardDialog = memo(function MoveToAnotherBoardDialog({
181181 setIsMoving ( true )
182182 setError ( null )
183183
184- const result = await moveCardToBoard (
185- cardId ,
186- effectiveBoardId ,
187- effectiveStatusId ,
188- )
189-
190- if ( result . success ) {
191- const selectedBoard = availableBoards . find (
192- ( b ) => b . id === effectiveBoardId ,
184+ try {
185+ const result = await moveCardToBoard (
186+ cardId ,
187+ effectiveBoardId ,
188+ effectiveStatusId ,
193189 )
194- toast . success ( 'Card moved' , {
195- description : `"${ repoName } " has been moved to ${ selectedBoard ?. name ?? 'board' } .` ,
196- } )
197- setSelectedBoardId ( '' )
198- setSelectedStatusId ( '' )
199- onMoved ( cardId )
200- onClose ( )
201- } else {
202- setError ( result . error || 'Failed to move card' )
203- }
204190
205- setIsMoving ( false )
191+ if ( result . success ) {
192+ const selectedBoard = availableBoards . find (
193+ ( b ) => b . id === effectiveBoardId ,
194+ )
195+ toast . success ( 'Card moved' , {
196+ description : `"${ repoName } " has been moved to ${ selectedBoard ?. name ?? 'board' } .` ,
197+ } )
198+ setSelectedBoardId ( '' )
199+ setSelectedStatusId ( '' )
200+ onMoved ( cardId )
201+ onClose ( )
202+ } else {
203+ setError ( result . error || 'Failed to move card' )
204+ }
205+ } catch {
206+ setError ( 'Failed to move card' )
207+ } finally {
208+ setIsMoving ( false )
209+ }
206210 } , [
207211 cardId ,
208212 effectiveBoardId ,
You can’t perform that action at this time.
0 commit comments