From fe2d69aad36daee71e43e13f7349e6e5f086b7fa Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Tue, 24 Sep 2024 19:37:59 +0530 Subject: [PATCH] mark as needing doing --- web/apps/photos/src/pages/gallery.tsx | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx index 4139c6b466..3d634c25ec 100644 --- a/web/apps/photos/src/pages/gallery.tsx +++ b/web/apps/photos/src/pages/gallery.tsx @@ -254,13 +254,7 @@ export default function Gallery() { const syncInProgress = useRef(true); const syncInterval = useRef(); const resync = useRef<{ force: boolean; silent: boolean }>(); - // tempDeletedFileIds and tempHiddenFileIds are used to keep track of files that are deleted/hidden in the current session but not yet synced with the server. - const [tempDeletedFileIds, setTempDeletedFileIds] = useState>( - new Set(), - ); - const [tempHiddenFileIds, setTempHiddenFileIds] = useState>( - new Set(), - ); + const { startLoading, finishLoading, @@ -340,6 +334,16 @@ export default function Gallery() { setFilesDownloadProgressAttributesList, ] = useState([]); + // tempDeletedFileIds and tempHiddenFileIds are used to keep track of files + // that are deleted/hidden in the current session but not yet synced with + // the server. + const [tempDeletedFileIds, setTempDeletedFileIds] = useState( + new Set(), + ); + const [tempHiddenFileIds, setTempHiddenFileIds] = useState( + new Set(), + ); + const router = useRouter(); // Ensure that the keys in local storage are not malformed by verifying that @@ -550,7 +554,13 @@ export default function Gallery() { } else if (barMode == "people") { const pfSet = new Set(ensure(activePerson).fileIDs); filteredFiles = getUniqueFiles( - files.filter((f) => pfSet.has(f.id)), + files.filter(({ id }) => { + if (!pfSet.has(id)) return false; + // TODO-Cluster + // if (tempDeletedFileIds?.has(id)) return false; + // if (tempHiddenFileIds?.has(id)) return false; + return true; + }), ); } else { const baseFiles = barMode == "hidden-albums" ? hiddenFiles : files;