Skip to content

Commit

Permalink
correct display of error icon, ensure that re-loading an errored page…
Browse files Browse the repository at this point in the history
… removes the error.
  • Loading branch information
devinleighsmith committed May 22, 2024
1 parent 04dd142 commit efa5c81
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
12 changes: 6 additions & 6 deletions source/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion source/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"react-dom": "18.2.0",
"react-draggable": "4.4.5",
"react-error-boundary": "3.1.4",
"react-icons": "4.11.0",
"react-icons": "5.2.1",
"react-idle-timer": "5.4.2",
"react-leaflet": "4.2.1",
"react-number-format": "4.9.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@ export const DocumentPreviewContainer: FC<
documentFileId: number,
documentFilePageId: number,
): Promise<string> => {
//todo: handle image failure
return createFileUrl(
await downloadDocumentFilePageImage(documentId, documentFileId, documentFilePageId),
const blob = await downloadDocumentFilePageImage(
documentId,
documentFileId,
documentFilePageId,
);

return createFileUrl(blob);
},
[downloadDocumentFilePageImage, createFileUrl],
);
Expand Down Expand Up @@ -135,6 +138,7 @@ export const DocumentPreviewContainer: FC<
const page = documentPages[currentPage];
// lazy load the next page, but do not replace lazy loaded data.
if (previewDocumentId && page && !page.loadedDocumentImageDataUrl) {
page.error = undefined;
loadDocumentPageImageUrl(
previewDocumentId,
page.mayanPage.document_file_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ export const useDocumentProvider = () => {
}
return Promise.reject(axiosError);
}, []),
throwError: true,
});

const { execute: getDocumentFilePageList, loading: getDocumentFilePageListLoading } =
Expand Down

0 comments on commit efa5c81

Please sign in to comment.