mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Remove most React memorization
Though added memo for timeline components making them (almost) pure
This commit is contained in:
@ -13,6 +13,8 @@ export type GlobalV0 = {
|
||||
// number
|
||||
'app.count_till_store_review'?: number
|
||||
'app.font_size'?: -1 | 0 | 1 | 2 | 3
|
||||
'version.global': number
|
||||
'version.account': number
|
||||
// boolean
|
||||
'app.auto_play_gifv'?: boolean
|
||||
|
||||
|
@ -3,7 +3,7 @@ import log from '@utils/startup/log'
|
||||
import { secureStorage, storage } from '@utils/storage'
|
||||
import { MMKV } from 'react-native-mmkv'
|
||||
|
||||
export const hasMigratedFromAsyncStorage = storage.global.getBoolean('hasMigratedFromAsyncStorage')
|
||||
export const versionStorageGlobal = storage.global.getNumber('version.global')
|
||||
|
||||
export async function migrateFromAsyncStorage(): Promise<void> {
|
||||
log('log', 'Migration', 'Migrating...')
|
||||
@ -107,7 +107,7 @@ export async function migrateFromAsyncStorage(): Promise<void> {
|
||||
throw error
|
||||
}
|
||||
|
||||
storage.global.set('hasMigratedFromAsyncStorage', true)
|
||||
storage.global.set('version.global', 0)
|
||||
|
||||
const end = global.performance.now()
|
||||
log('log', 'Migration', `Migrated in ${end - start}ms`)
|
||||
|
@ -19,7 +19,7 @@ const ManageThemeContext = createContext<ContextType>({
|
||||
|
||||
export const useTheme = () => useContext(ManageThemeContext)
|
||||
|
||||
const useColorSchemeDelay = (delay = 500) => {
|
||||
const useColorSchemeDelay = (delay = 50) => {
|
||||
const [colorScheme, setColorScheme] = React.useState(Appearance.getColorScheme())
|
||||
const onColorSchemeChange = React.useCallback(
|
||||
throttle(
|
||||
|
Reference in New Issue
Block a user