From 5a524fa5b016aa90e9274388359774105e5ac60b Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Fri, 21 Mar 2025 16:56:25 +0530 Subject: [PATCH 1/2] Fix viewer close on deletion of last file --- web/packages/gallery/components/viewer/FileViewer.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/web/packages/gallery/components/viewer/FileViewer.tsx b/web/packages/gallery/components/viewer/FileViewer.tsx index 643eb620bf..2c16dd77be 100644 --- a/web/packages/gallery/components/viewer/FileViewer.tsx +++ b/web/packages/gallery/components/viewer/FileViewer.tsx @@ -827,8 +827,10 @@ export const FileViewer: React.FC = ({ }, [handleClose, files]); useEffect(() => { - psRef.current?.refreshCurrentSlideFavoriteButtonIfNeeded(); - }, [favoriteFileIDs, pendingFavoriteUpdates]); + if (open) { + psRef.current?.refreshCurrentSlideFavoriteButtonIfNeeded(); + } + }, [favoriteFileIDs, pendingFavoriteUpdates, open]); useEffect(() => { if (open) { @@ -840,7 +842,9 @@ export const FileViewer: React.FC = ({ disableDownload, haveUser, delegate: delegateRef.current!, - onClose: handleClose, + onClose: () => { + if (psRef.current) handleClose(); + }, onAnnotate: handleAnnotate, onViewInfo: handleViewInfo, onDownload: handleDownloadBarAction, From a4ab3168ad2c4d9c0ff764ae511ae3df7cbf308b Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Fri, 21 Mar 2025 16:59:10 +0530 Subject: [PATCH 2/2] Add note --- server/compose.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/compose.yaml b/server/compose.yaml index eb05b889a5..1def7f528e 100644 --- a/server/compose.yaml +++ b/server/compose.yaml @@ -73,6 +73,8 @@ services: configs: credentials_yaml: + # You'll need to recreate the containers (docker compose down && docker + # compose up) when changing this inline config for the changes to apply. content: | db: host: postgres