mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Improve loading remote images
This commit is contained in:
@ -52,8 +52,8 @@ const ImageItem = ({
|
||||
const scrollViewRef = useRef<ScrollView>(null)
|
||||
const [scaled, setScaled] = useState(false)
|
||||
const [imageDimensions, setImageDimensions] = useState({
|
||||
width: imageSrc.width || 0,
|
||||
height: imageSrc.height || 0
|
||||
width: imageSrc.width || 1,
|
||||
height: imageSrc.height || 1
|
||||
})
|
||||
const handleDoubleTap = useDoubleTapToZoom(scrollViewRef, scaled, SCREEN)
|
||||
|
||||
|
@ -58,7 +58,7 @@ const saveIos = async ({ messageRef, mode, image }: CommonProps) => {
|
||||
}
|
||||
|
||||
const saveAndroid = async ({ messageRef, mode, image }: CommonProps) => {
|
||||
const fileUri: string = `${FileSystem.documentDirectory}test.jpg`
|
||||
const fileUri: string = `${FileSystem.documentDirectory}${image.id}.jpg`
|
||||
const downloadedFile: FileSystem.FileSystemDownloadResult = await FileSystem.downloadAsync(
|
||||
image.url,
|
||||
fileUri
|
||||
@ -80,7 +80,7 @@ const saveAndroid = async ({ messageRef, mode, image }: CommonProps) => {
|
||||
ref: messageRef,
|
||||
mode,
|
||||
type: 'success',
|
||||
message: 'test'
|
||||
message: i18next.t('screenImageViewer:content.save.succeed')
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
|
Reference in New Issue
Block a user