File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
frontend/src/pages/Reports Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ const ReportDetailPage: React.FC = () => {
9090 try {
9191 setIsProcessing ( true ) ;
9292 await axios . delete ( `${ API_URL } /api/reports/${ reportId } ` , await getAuthConfig ( ) ) ;
93+ setIsProcessing ( false ) ;
9394
9495 // Show toast notification
9596 createToast ( {
@@ -103,6 +104,8 @@ const ReportDetailPage: React.FC = () => {
103104 // Navigate back
104105 history . push ( '/tabs/home' ) ;
105106 } catch ( error ) {
107+ setIsProcessing ( false ) ;
108+
106109 console . error ( 'Error discarding report:' , error ) ;
107110 createToast ( {
108111 message : t ( 'report.discard.error' , {
@@ -112,21 +115,19 @@ const ReportDetailPage: React.FC = () => {
112115 duration : 2000 ,
113116 color : 'danger' ,
114117 } ) ;
115- } finally {
116- setIsProcessing ( false ) ;
117118 }
118119 } ;
119120
120121 const handleNewUpload = async ( setIsProcessing : ( isProcessing : boolean ) => void ) => {
121122 try {
122123 setIsProcessing ( true ) ;
123124 await axios . delete ( `${ API_URL } /api/reports/${ reportId } ` , await getAuthConfig ( ) ) ;
125+ setIsProcessing ( false ) ;
124126
125127 history . push ( '/tabs/upload' ) ;
126128 } catch ( error ) {
127- console . error ( 'Error deleting report before new upload:' , error ) ;
128- } finally {
129129 setIsProcessing ( false ) ;
130+ console . error ( 'Error deleting report before new upload:' , error ) ;
130131 }
131132 } ;
132133
You can’t perform that action at this time.
0 commit comments