Fix all type errors

This commit is contained in:
Paul Frazee 2023-01-26 11:25:52 -06:00
parent c4ba5e7fd5
commit 7e3f6f0306
45 changed files with 377 additions and 294 deletions

View file

@ -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') {