diff --git a/web/apps/photos/src/components/PhotoViewer/index.tsx b/web/apps/photos/src/components/PhotoViewer/index.tsx index 31df61424a..5a95b8337e 100644 --- a/web/apps/photos/src/components/PhotoViewer/index.tsx +++ b/web/apps/photos/src/components/PhotoViewer/index.tsx @@ -521,13 +521,6 @@ export const PhotoViewer: React.FC = ({ 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) => { if (!file || !isOwnFile || isTrashCollection) { return; @@ -537,8 +530,12 @@ export const PhotoViewer: React.FC = ({ }; const handleDeleteFile = async () => { - await trashFile(fileToDelete!); + const file = fileToDelete!; + await moveToTrash([file]); + markTempDeleted?.([file]); + updateItems(items.filter((item) => item.id !== file.id)); setFileToDelete(undefined); + needUpdate.current = true; }; const handleArrowClick = (