Add option to clear cover cache
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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};
|
||||
Reference in New Issue
Block a user