File tree Expand file tree Collapse file tree 3 files changed +20
-8
lines changed
Expand file tree Collapse file tree 3 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -92,12 +92,8 @@ export const useToggleReportBookmark = () => {
9292
9393 // Update the bookmark status in the report detail page
9494 queryClient . setQueryData < MedicalReport | undefined > (
95- [ QueryKey . ReportDetail , reportId ] ,
96- ( oldReport ) => {
97- if ( ! oldReport ) return undefined ;
98- if ( oldReport . id !== updatedReport . id ) return oldReport ;
99- return { ...oldReport , bookmarked : updatedReport . bookmarked } ;
100- } ,
95+ [ QueryKey . ReportDetail , updatedReport . id ] ,
96+ ( report ) => ( report ?. id === updatedReport . id ? updatedReport : report ) ,
10197 ) ;
10298 } ,
10399 } ) ;
Original file line number Diff line number Diff line change @@ -118,6 +118,8 @@ const ProcessingPage: React.FC = () => {
118118 history . push ( `/tabs/reports/${ reportId } ` ) ;
119119 }
120120
121+ clearStatusCheckInterval ( ) ;
122+
121123 // Start checking the status every 2 seconds
122124 statusCheckIntervalRef . current = window . setInterval ( checkReportStatus , 2000 ) ;
123125 } catch ( error ) {
Original file line number Diff line number Diff line change 11import { IonButton } from '@ionic/react' ;
2- import { useHistory } from 'react-router-dom' ;
32import '../ProcessingPage.scss' ;
43import warning from '../../../assets/icons/warning.svg' ;
4+ import UploadModal from 'common/components/Upload/UploadModal' ;
5+ import { useState } from 'react' ;
6+ import { useHistory } from 'react-router' ;
57
68interface ProcessingErrorProps {
79 errorMessage : string ;
@@ -19,6 +21,12 @@ const ProcessingError: React.FC<ProcessingErrorProps> = ({
1921 onRetry,
2022} ) => {
2123 const history = useHistory ( ) ;
24+ const [ isUploadModalOpen , setIsUploadModalOpen ] = useState ( false ) ;
25+
26+ const handleUploadComplete = ( ) => {
27+ setIsUploadModalOpen ( false ) ;
28+ history . push ( '/tabs/home' ) ;
29+ } ;
2230
2331 return (
2432 < div className = "processing-page__error-container" >
@@ -54,10 +62,16 @@ const ProcessingError: React.FC<ProcessingErrorProps> = ({
5462 expand = "block"
5563 shape = "round"
5664 color = "primary"
57- onClick = { ( ) => history . push ( '/tabs/upload' ) }
65+ onClick = { ( ) => setIsUploadModalOpen ( true ) }
5866 >
5967 New Upload
6068 </ IonButton >
69+
70+ < UploadModal
71+ isOpen = { isUploadModalOpen }
72+ onClose = { handleUploadComplete }
73+ onUploadComplete = { handleUploadComplete }
74+ />
6175 </ div >
6276 </ div >
6377 ) ;
You can’t perform that action at this time.
0 commit comments