Skip to content

Commit a8af8dd

Browse files
authored
Merge pull request #144 from ModusCreateOrg/ADE-215
[ADE-215] fixes
2 parents e9e5bb9 + 0c404b2 commit a8af8dd

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

frontend/src/common/hooks/useReports.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff 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
});

frontend/src/pages/Processing/ProcessingPage.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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) {

frontend/src/pages/Processing/components/ProcessingError.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { IonButton } from '@ionic/react';
2-
import { useHistory } from 'react-router-dom';
32
import '../ProcessingPage.scss';
43
import 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

68
interface 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
);

0 commit comments

Comments
 (0)