From 1a3d665655fb8914a4d0be4a669e01c51cf7d2e8 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Thu, 6 Feb 2025 09:15:27 +0530 Subject: [PATCH] Inline --- .../photos/src/components/PhotoViewer/index.tsx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) 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 = (