Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Inline

Manav Rathi1a3d665655fb
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<PhotoViewerProps> = ({
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<PhotoViewerProps> = ({
};
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 = (