Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix

Manav Rathi06e60d60ca1a
diff --git a/web/packages/new/photos/components/gallery/reducer.ts b/web/packages/new/photos/components/gallery/reducer.ts
index 78f80e8f2f..ac408d0dd3 100644
--- a/web/packages/new/photos/components/gallery/reducer.ts
+++ b/web/packages/new/photos/components/gallery/reducer.ts
@@ -891,11 +891,20 @@ const galleryReducer: React.Reducer<GalleryState, GalleryAction> = (
const unsyncedVisibilityUpdates = new Map(
state.unsyncedVisibilityUpdates,
);
+
+ // Remove any pending updates for this file.
+ let pendingVisibilityUpdates = state.pendingVisibilityUpdates;
+ if (pendingVisibilityUpdates.has(action.fileID)) {
+ pendingVisibilityUpdates = new Set(pendingVisibilityUpdates);
+ pendingVisibilityUpdates.delete(action.fileID);
+ }
+
if (action.visibility === undefined) {
unsyncedVisibilityUpdates.delete(action.fileID);
} else {
unsyncedVisibilityUpdates.set(action.fileID, action.visibility);
}
+
return stateByUpdatingFilteredFiles({
...state,
archivedFileIDs: deriveArchivedFileIDs(
@@ -903,6 +912,7 @@ const galleryReducer: React.Reducer<GalleryState, GalleryAction> = (
state.files,
unsyncedVisibilityUpdates,
),
+ pendingVisibilityUpdates,
unsyncedVisibilityUpdates,
});
}