mirror of https://github.com/tooot-app/app
Fixed #106
This commit is contained in:
parent
c9964f8d1f
commit
292101ab30
|
@ -6,7 +6,9 @@ const saveIos = async (
|
||||||
image: Nav.RootStackParamList['Screen-ImagesViewer']['imageUrls'][0]
|
image: Nav.RootStackParamList['Screen-ImagesViewer']['imageUrls'][0]
|
||||||
) => {
|
) => {
|
||||||
CameraRoll.save(image.url)
|
CameraRoll.save(image.url)
|
||||||
.then(() => haptics('Success'))
|
.then(() => {
|
||||||
|
haptics('Success')
|
||||||
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
if (image.remote_url) {
|
if (image.remote_url) {
|
||||||
CameraRoll.save(image.remote_url)
|
CameraRoll.save(image.remote_url)
|
||||||
|
|
|
@ -11,15 +11,19 @@ import {
|
||||||
useSafeAreaInsets
|
useSafeAreaInsets
|
||||||
} from 'react-native-safe-area-context'
|
} from 'react-native-safe-area-context'
|
||||||
import ImageViewer from './ImageViewer/Root'
|
import ImageViewer from './ImageViewer/Root'
|
||||||
|
import { saveAndroid, saveIos } from './ImageViewer/save'
|
||||||
|
|
||||||
const saveImage = async (
|
const saveImage = async (
|
||||||
image: Nav.RootStackParamList['Screen-ImagesViewer']['imageUrls'][0]
|
image: Nav.RootStackParamList['Screen-ImagesViewer']['imageUrls'][0]
|
||||||
) => {
|
) => {
|
||||||
const save = require('./ImageViewer/save')
|
switch (Platform.OS) {
|
||||||
Platform.select({
|
case 'ios':
|
||||||
ios: save.saveIos(image),
|
saveIos(image)
|
||||||
android: save.saveAndroid(image)
|
break
|
||||||
})
|
case 'android':
|
||||||
|
saveAndroid(image)
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const HeaderComponent = React.memo(
|
const HeaderComponent = React.memo(
|
||||||
|
|
Loading…
Reference in New Issue