diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-11-15 17:17:50 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-15 17:17:50 -0800 |
commit | 6616b2bff098ff4a5e464c175edf2446dae0cc88 (patch) | |
tree | fb314b51dd3d17b488fa2971735aa7c19176493b /src/view/shell/Drawer.tsx | |
parent | f23e9978d839322aab7304d2b6f183722e3ad4c1 (diff) | |
download | voidsky-6616b2bff098ff4a5e464c175edf2446dae0cc88.tar.zst |
Shell behaviors update (react-query refactor) (#1915)
* Move tick-every-minute into a hook/context * Move soft-reset event out of the shell model * Update soft-reset listener on new search page * Implement session-loaded and session-dropped events * Update analytics and push-notifications to use new session system
Diffstat (limited to 'src/view/shell/Drawer.tsx')
-rw-r--r-- | src/view/shell/Drawer.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/view/shell/Drawer.tsx b/src/view/shell/Drawer.tsx index 8a84a07c6..c5dcb150c 100644 --- a/src/view/shell/Drawer.tsx +++ b/src/view/shell/Drawer.tsx @@ -50,6 +50,7 @@ import {useModalControls} from '#/state/modals' import {useSession, SessionAccount} from '#/state/session' import {useProfileQuery} from '#/state/queries/profile' import {useUnreadNotifications} from '#/state/queries/notifications/unread' +import {emitSoftReset} from '#/state/events' export function DrawerProfileCard({ account, @@ -103,7 +104,6 @@ export function DrawerProfileCard({ export const DrawerContent = observer(function DrawerContentImpl() { const theme = useTheme() const pal = usePalette('default') - const store = useStores() const {_} = useLingui() const setDrawerOpen = useSetDrawerOpen() const navigation = useNavigation<NavigationProp>() @@ -124,7 +124,7 @@ export const DrawerContent = observer(function DrawerContentImpl() { if (isWeb) { // hack because we have flat navigator for web and MyProfile does not exist on the web navigator -ansh if (tab === 'MyProfile') { - navigation.navigate('Profile', {name: store.me.handle}) + navigation.navigate('Profile', {name: currentAccount!.handle}) } else { // @ts-ignore must be Home, Search, Notifications, or MyProfile navigation.navigate(tab) @@ -132,7 +132,7 @@ export const DrawerContent = observer(function DrawerContentImpl() { } else { const tabState = getTabState(state, tab) if (tabState === TabState.InsideAtRoot) { - store.emitScreenSoftReset() + emitSoftReset() } else if (tabState === TabState.Inside) { navigation.dispatch(StackActions.popToTop()) } else { @@ -141,7 +141,7 @@ export const DrawerContent = observer(function DrawerContentImpl() { } } }, - [store, track, navigation, setDrawerOpen], + [track, navigation, setDrawerOpen, currentAccount], ) const onPressHome = React.useCallback(() => onPressTab('Home'), [onPressTab]) |