Add option to clear cover cache

This commit is contained in:
Rajarshee Chatterjee
2021-12-21 18:03:00 +05:30
parent ecc8c35bfb
commit ceca91fcab
2 changed files with 17 additions and 1 deletions
@@ -11,6 +11,7 @@ import {showToast} from '../../hooks/showToast';
import {deleteNovelCache} from '../../database/queries/NovelQueries';
import {clearUpdates} from '../../database/queries/UpdateQueries';
import {clearCoverCache} from '../../services/utils/coverCache';
const AdvancedSettings = ({navigation}) => {
const theme = useTheme();
@@ -30,7 +31,7 @@ const AdvancedSettings = ({navigation}) => {
<ScreenContainer theme={theme}>
<Appbar title="Advanced" onBackAction={() => navigation.goBack()} />
<List.Section>
<List.SubHeader theme={theme}>Data</List.SubHeader>
<List.SubHeader theme={theme}>Data Management</List.SubHeader>
<List.Item
title="Clear database"
description="Delete history for novels not in your library"
@@ -43,6 +44,12 @@ const AdvancedSettings = ({navigation}) => {
onPress={showClearUpdatesDialog}
theme={theme}
/>
<List.Item
title="Clean up cached covers"
description="Delete all covers cached"
onPress={clearCoverCache}
theme={theme}
/>
</List.Section>
<Portal>
<Dialog
+9
View File
@@ -0,0 +1,9 @@
import FastImage from 'react-native-fast-image';
import {showToast} from '../../hooks/showToast';
const clearCoverCache = () => {
FastImage.clearDiskCache();
showToast('Cleared cover cache.');
};
export {clearCoverCache};