This commit is contained in:
Manav Rathi 2025-02-06 09:15:27 +05:30
parent 02f3afc4cc
commit 1a3d665655
No known key found for this signature in database

View File

@ -521,13 +521,6 @@ export const PhotoViewer: React.FC<PhotoViewerProps> = ({
needUpdate.current = true; needUpdate.current = true;
}; };
const trashFile = async (file: DisplayFile) => {
await moveToTrash([file]);
markTempDeleted?.([file]);
updateItems(items.filter((item) => item.id !== file.id));
needUpdate.current = true;
};
const confirmDeleteFile = (file: EnteFile) => { const confirmDeleteFile = (file: EnteFile) => {
if (!file || !isOwnFile || isTrashCollection) { if (!file || !isOwnFile || isTrashCollection) {
return; return;
@ -537,8 +530,12 @@ export const PhotoViewer: React.FC<PhotoViewerProps> = ({
}; };
const handleDeleteFile = async () => { const handleDeleteFile = async () => {
await trashFile(fileToDelete!); const file = fileToDelete!;
await moveToTrash([file]);
markTempDeleted?.([file]);
updateItems(items.filter((item) => item.id !== file.id));
setFileToDelete(undefined); setFileToDelete(undefined);
needUpdate.current = true;
}; };
const handleArrowClick = ( const handleArrowClick = (