mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
619 restructure local storage (#628)
* To MMKV migration working * POC migrated font size settings * Moved settings to mmkv * Fix typos * Migrated contexts slice * Migrated app slice * POC instance emoji update * Migrated drafts * Migrated simple instance properties * All migrated! * Re-structure files * Tolerant of undefined settings * Can properly logging in and out including empty state
This commit is contained in:
6
src/utils/navigation/navigationRef.ts
Normal file
6
src/utils/navigation/navigationRef.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { createNavigationContainerRef } from '@react-navigation/native'
|
||||
import { RootStackParamList } from '@utils/navigation/navigators'
|
||||
|
||||
const navigationRef = createNavigationContainerRef<RootStackParamList>()
|
||||
|
||||
export default navigationRef
|
@ -1,17 +1,16 @@
|
||||
import { StackActions, useNavigation } from '@react-navigation/native'
|
||||
import { getInstanceActive } from '@utils/slices/instancesSlice'
|
||||
import { useNavigation } from '@react-navigation/native'
|
||||
import { useGlobalStorage } from '@utils/storage/actions'
|
||||
import { useEffect } from 'react'
|
||||
import { useSelector } from 'react-redux'
|
||||
|
||||
// Mostly used when switching account and sub pages were still querying the old instance
|
||||
|
||||
const usePopToTop = () => {
|
||||
const navigation = useNavigation()
|
||||
const instanceActive = useSelector(getInstanceActive)
|
||||
const [accountActive] = useGlobalStorage.string('account.active')
|
||||
|
||||
return useEffect(() => {
|
||||
navigation.dispatch(StackActions.popToTop())
|
||||
}, [instanceActive])
|
||||
// navigation.dispatch(StackActions.popToTop())
|
||||
}, [accountActive])
|
||||
}
|
||||
|
||||
export default usePopToTop
|
||||
|
Reference in New Issue
Block a user