diff --git a/src/screens/novel/components/Info/NovelInfoComponents.js b/src/screens/novel/components/Info/NovelInfoComponents.js index ab0076c31..2910cb2d8 100644 --- a/src/screens/novel/components/Info/NovelInfoComponents.js +++ b/src/screens/novel/components/Info/NovelInfoComponents.js @@ -8,6 +8,7 @@ import { Dimensions, StatusBar, } from 'react-native'; +import RNFetchBlob from 'rn-fetch-blob'; import color from 'color'; import { IconButton, Portal } from 'react-native-paper'; import { LinearGradient } from 'expo-linear-gradient'; @@ -16,6 +17,7 @@ import FastImage from 'react-native-fast-image'; import { TouchableWithoutFeedback } from 'react-native-gesture-handler'; import { Chip } from '../../../../components'; import { coverPlaceholderColor } from '../../../../theme/colors'; +import { showToast } from '@hooks/showToast'; const NovelInfoContainer = ({ children }) => ( {children} @@ -69,17 +71,41 @@ const NovelThumbnail = ({ source, theme, setCustomNovelCover }) => { } else { return ( - + > + + { + RNFetchBlob.config({ + fileCache: true, + addAndroidDownloads: { + useDownloadManager: true, + notification: true, + path: + RNFetchBlob.fs.dirs.DownloadDir + + '/' + + source.uri.split('/').pop(), + description: 'Image', + }, + }) + .fetch('GET', source.uri) + .then(() => showToast('Cover saved')); + }} + /> +