File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
frontend/src/pages/Reports Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,6 @@ const ReportDetailPage: React.FC = () => {
9090 try {
9191 setIsProcessing ( true ) ;
9292 await axios . delete ( `${ API_URL } /api/reports/${ reportId } ` , await getAuthConfig ( ) ) ;
93- setIsProcessing ( false ) ;
9493
9594 // Show toast notification
9695 createToast ( {
@@ -113,18 +112,21 @@ const ReportDetailPage: React.FC = () => {
113112 duration : 2000 ,
114113 color : 'danger' ,
115114 } ) ;
115+ } finally {
116+ setIsProcessing ( false ) ;
116117 }
117118 } ;
118119
119120 const handleNewUpload = async ( setIsProcessing : ( isProcessing : boolean ) => void ) => {
120121 try {
121122 setIsProcessing ( true ) ;
122123 await axios . delete ( `${ API_URL } /api/reports/${ reportId } ` , await getAuthConfig ( ) ) ;
123- setIsProcessing ( false ) ;
124124
125125 history . push ( '/tabs/upload' ) ;
126126 } catch ( error ) {
127127 console . error ( 'Error deleting report before new upload:' , error ) ;
128+ } finally {
129+ setIsProcessing ( false ) ;
128130 }
129131 } ;
130132
You can’t perform that action at this time.
0 commit comments