mirror of
				https://github.com/tooot-app/app
				synced 2025-06-05 22:19:13 +02:00 
			
		
		
		
	Test clearing disk cache
This commit is contained in:
		| @@ -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> | ||||
|   ) | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user