mirror of
https://github.com/tooot-app/app
synced 2025-03-12 09:30:11 +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 React, { useEffect, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { Linking, Platform } from 'react-native'
|
import { Linking, Platform } from 'react-native'
|
||||||
|
import FastImage from 'react-native-fast-image'
|
||||||
import { GLOBAL } from '../../../../App'
|
import { GLOBAL } from '../../../../App'
|
||||||
import { mapFontsizeToName } from '../SettingsFontsize'
|
import { mapFontsizeToName } from '../SettingsFontsize'
|
||||||
|
|
||||||
@ -43,6 +44,8 @@ const SettingsApp: React.FC = () => {
|
|||||||
})
|
})
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
const [clearingCache, setClearingCache] = useState(false)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MenuContainer>
|
<MenuContainer>
|
||||||
<MenuRow
|
<MenuRow
|
||||||
@ -181,6 +184,17 @@ const SettingsApp: React.FC = () => {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
|
<MenuRow
|
||||||
|
title='Clear cache'
|
||||||
|
iconBack='chevron-right'
|
||||||
|
loading={clearingCache}
|
||||||
|
onPress={() => {
|
||||||
|
setClearingCache(true)
|
||||||
|
FastImage.clearDiskCache()
|
||||||
|
.then(() => setClearingCache(false))
|
||||||
|
.catch(() => setClearingCache(false))
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</MenuContainer>
|
</MenuContainer>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user