From 7e3f6f030680a8cf7b5baa3ce6f33acd5766fca8 Mon Sep 17 00:00:00 2001
From: Paul Frazee <pfrazee@gmail.com>
Date: Thu, 26 Jan 2023 11:25:52 -0600
Subject: Fix all type errors

---
 src/view/com/lightbox/Lightbox.tsx | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

(limited to 'src/view/com/lightbox/Lightbox.tsx')

diff --git a/src/view/com/lightbox/Lightbox.tsx b/src/view/com/lightbox/Lightbox.tsx
index c777a5528..df5839783 100644
--- a/src/view/com/lightbox/Lightbox.tsx
+++ b/src/view/com/lightbox/Lightbox.tsx
@@ -5,6 +5,7 @@ import ImageView from './ImageViewing'
 import {useStores} from '../../../state'
 import * as models from '../../../state/models/shell-ui'
 import {saveImageModal} from '../../../lib/images'
+import {ImageSource} from './ImageViewing/@types'
 
 export const Lightbox = observer(function Lightbox() {
   const store = useStores()
@@ -15,8 +16,14 @@ export const Lightbox = observer(function Lightbox() {
   const onClose = () => {
     store.shell.closeLightbox()
   }
-  const onLongPress = ({uri}: {uri: string}) => {
-    saveImageModal({uri})
+  const onLongPress = (image: ImageSource) => {
+    if (
+      typeof image === 'object' &&
+      'uri' in image &&
+      typeof image.uri === 'string'
+    ) {
+      saveImageModal({uri: image.uri})
+    }
   }
 
   if (store.shell.activeLightbox?.name === 'profile-image') {
-- 
cgit 1.4.1

