update behaviour to not move to destination collection after collection ops (#1556)
This commit is contained in:
commit
4e9fb6a632
1 changed files with 20 additions and 5 deletions
|
@ -836,13 +836,20 @@ 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
|
||||
) {
|
||||
// redirect to all section when no items are left in the current collection.
|
||||
setActiveCollectionID(ALL_SECTION);
|
||||
} else if (ops === COLLECTION_OPS_TYPE.UNHIDE) {
|
||||
exitHiddenSection();
|
||||
}
|
||||
}
|
||||
clearSelection();
|
||||
await syncWithRemote(false, true);
|
||||
if (isInHiddenSection && ops === COLLECTION_OPS_TYPE.UNHIDE) {
|
||||
exitHiddenSection();
|
||||
}
|
||||
setActiveCollectionID(collection.id);
|
||||
} catch (e) {
|
||||
logError(e, 'collection ops failed', { ops });
|
||||
setDialogMessage({
|
||||
|
@ -877,6 +884,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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue