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