Skip to content

armgit / ente

Public Imported from GitHub
0

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

close album if empty after operation

Abhinavc04794f26e10
diff --git a/apps/photos/src/pages/gallery/index.tsx b/apps/photos/src/pages/gallery/index.tsx
index 52055ff608..9efd8ea6d0 100644
--- a/apps/photos/src/pages/gallery/index.tsx
+++ b/apps/photos/src/pages/gallery/index.tsx
@@ -836,7 +836,17 @@ export default function Gallery() {
selected.collectionID
);
}
-
+ if (selected?.ownCount === filteredData?.length) {
+ if (
+ ops === COLLECTION_OPS_TYPE.REMOVE ||
+ ops === COLLECTION_OPS_TYPE.RESTORE ||
+ ops === COLLECTION_OPS_TYPE.MOVE
+ ) {
+ setActiveCollectionID(ALL_SECTION);
+ } else if (ops === COLLECTION_OPS_TYPE.UNHIDE) {
+ exitHiddenSection();
+ }
+ }
clearSelection();
await syncWithRemote(false, true);
} catch (e) {
@@ -873,6 +883,14 @@ export default function Gallery() {
setFixCreationTimeAttributes
);
}
+ if (
+ selected?.ownCount === filteredData?.length &&
+ ops !== FILE_OPS_TYPE.ARCHIVE &&
+ ops !== FILE_OPS_TYPE.DOWNLOAD &&
+ ops !== FILE_OPS_TYPE.FIX_TIME
+ ) {
+ setActiveCollectionID(ALL_SECTION);
+ }
clearSelection();
await syncWithRemote(false, true);
} catch (e) {