commit
efb61ab53f
|
@ -326,12 +326,12 @@ export default function Gallery() {
|
|||
setCollectionSelectorView,
|
||||
selected,
|
||||
files,
|
||||
clearSelection,
|
||||
syncWithRemote,
|
||||
|
||||
setActiveCollection,
|
||||
collectionName,
|
||||
collection
|
||||
);
|
||||
clearSelection();
|
||||
} catch (e) {
|
||||
setDialogMessage({
|
||||
title: constants.ERROR,
|
||||
|
@ -339,6 +339,9 @@ export default function Gallery() {
|
|||
close: { variant: 'danger' },
|
||||
content: constants.UNKNOWN_ERROR,
|
||||
});
|
||||
} finally {
|
||||
await syncWithRemote(false, true);
|
||||
loadingBar.current.complete();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -353,12 +356,12 @@ export default function Gallery() {
|
|||
setCollectionSelectorView,
|
||||
selected,
|
||||
files,
|
||||
clearSelection,
|
||||
syncWithRemote,
|
||||
|
||||
setActiveCollection,
|
||||
collectionName,
|
||||
collection
|
||||
);
|
||||
clearSelection();
|
||||
} catch (e) {
|
||||
setDialogMessage({
|
||||
title: constants.ERROR,
|
||||
|
@ -366,6 +369,9 @@ export default function Gallery() {
|
|||
close: { variant: 'danger' },
|
||||
content: constants.UNKNOWN_ERROR,
|
||||
});
|
||||
} finally {
|
||||
await syncWithRemote(false, true);
|
||||
loadingBar.current.complete();
|
||||
}
|
||||
};
|
||||
const changeFilesVisibilityHelper = async (
|
||||
|
@ -379,6 +385,7 @@ export default function Gallery() {
|
|||
visibility
|
||||
);
|
||||
await updateMagicMetadata(updatedFiles);
|
||||
clearSelection();
|
||||
} catch (e) {
|
||||
switch (e.status?.toString()) {
|
||||
case ServerErrorCodes.FORBIDDEN:
|
||||
|
@ -397,8 +404,7 @@ export default function Gallery() {
|
|||
content: constants.UNKNOWN_ERROR,
|
||||
});
|
||||
} finally {
|
||||
clearSelection();
|
||||
syncWithRemote();
|
||||
await syncWithRemote(false, true);
|
||||
loadingBar.current.complete();
|
||||
}
|
||||
};
|
||||
|
@ -445,6 +451,7 @@ export default function Gallery() {
|
|||
const fileIds = getSelectedFileIds(selected);
|
||||
await deleteFiles(fileIds);
|
||||
setDeleted([...deleted, ...fileIds]);
|
||||
clearSelection();
|
||||
} catch (e) {
|
||||
switch (e.status?.toString()) {
|
||||
case ServerErrorCodes.FORBIDDEN:
|
||||
|
@ -462,8 +469,7 @@ export default function Gallery() {
|
|||
content: constants.UNKNOWN_ERROR,
|
||||
});
|
||||
} finally {
|
||||
clearSelection();
|
||||
syncWithRemote();
|
||||
await syncWithRemote(false, true);
|
||||
loadingBar.current.complete();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -21,8 +21,6 @@ export async function copyOrMoveFromCollection(
|
|||
setCollectionSelectorView: (value: boolean) => void,
|
||||
selected: SelectedState,
|
||||
files: File[],
|
||||
clearSelection: () => void,
|
||||
syncWithRemote: () => Promise<void>,
|
||||
setActiveCollection: (id: number) => void,
|
||||
collectionName: string,
|
||||
existingCollection: Collection
|
||||
|
@ -52,8 +50,6 @@ export async function copyOrMoveFromCollection(
|
|||
default:
|
||||
throw Error(CustomError.INVALID_COLLECTION_OPERATION);
|
||||
}
|
||||
clearSelection();
|
||||
await syncWithRemote();
|
||||
setActiveCollection(collection.id);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue