From 1c81bfa7f2ee306a71c6f69d582df329653a9192 Mon Sep 17 00:00:00 2001 From: Christopher Date: Sun, 28 Feb 2021 00:05:07 +0100 Subject: [PATCH] fix(camera): resolve issue for deleting images --- phone/src/apps/camera/components/CameraApp.tsx | 2 +- .../apps/camera/components/modal/GalleryModal.tsx | 12 ++++++++---- resources/server/sv_photo.ts | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/phone/src/apps/camera/components/CameraApp.tsx b/phone/src/apps/camera/components/CameraApp.tsx index cc170c9..6c6b175 100644 --- a/phone/src/apps/camera/components/CameraApp.tsx +++ b/phone/src/apps/camera/components/CameraApp.tsx @@ -16,7 +16,7 @@ InjectDebugData([ image: 'https://i.imgur.com/OO8wx6Z.jpg', }, { - id: 1, + id: 2, image: 'https://i.imgur.com/pqGBiST.jpg', }, ], diff --git a/phone/src/apps/camera/components/modal/GalleryModal.tsx b/phone/src/apps/camera/components/modal/GalleryModal.tsx index 5f3b414..96b0522 100644 --- a/phone/src/apps/camera/components/modal/GalleryModal.tsx +++ b/phone/src/apps/camera/components/modal/GalleryModal.tsx @@ -27,12 +27,12 @@ export const GalleryModal = () => { history.push(referal); }; - const handleDeletePhoto = useCallback(() => { + const handleDeletePhoto = () => { Nui.send('photo:deletePhoto', { - id: meta.id, + image: meta.image, }); history.push(referal); - }, [history, meta.id, referal]); + }; const handleSharePhoto = useCallback(() => { setShareOpen(meta); @@ -42,7 +42,11 @@ export const GalleryModal = () => { return ( <> - setShareOpen(null)} /> + setShareOpen(null)} + />