mirror of
https://github.com/tooot-app/app
synced 2025-03-12 01:20:06 +01:00
Test clearing disk cache
This commit is contained in:
parent
c21e99909d
commit
968a3266c2
@ -11,6 +11,7 @@ import * as Localization from 'expo-localization'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Linking, Platform } from 'react-native'
|
||||
import FastImage from 'react-native-fast-image'
|
||||
import { GLOBAL } from '../../../../App'
|
||||
import { mapFontsizeToName } from '../SettingsFontsize'
|
||||
|
||||
@ -43,6 +44,8 @@ const SettingsApp: React.FC = () => {
|
||||
})
|
||||
}, [])
|
||||
|
||||
const [clearingCache, setClearingCache] = useState(false)
|
||||
|
||||
return (
|
||||
<MenuContainer>
|
||||
<MenuRow
|
||||
@ -181,6 +184,17 @@ const SettingsApp: React.FC = () => {
|
||||
}}
|
||||
/>
|
||||
) : null}
|
||||
<MenuRow
|
||||
title='Clear cache'
|
||||
iconBack='chevron-right'
|
||||
loading={clearingCache}
|
||||
onPress={() => {
|
||||
setClearingCache(true)
|
||||
FastImage.clearDiskCache()
|
||||
.then(() => setClearingCache(false))
|
||||
.catch(() => setClearingCache(false))
|
||||
}}
|
||||
/>
|
||||
</MenuContainer>
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user