From 50f811666aa8999bd7c6cf0c823437f23ddce4c6 Mon Sep 17 00:00:00 2001 From: Ansh Date: Fri, 15 Sep 2023 04:40:59 +0530 Subject: Fix Profile link from drawer on Mobile Web (#1437) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🗺️ fix an issue where web devices that see the Drawer couldn't access Profile from said Drawer * fix routes on web * handle profile button active state * add hack for web navigation * fix comment --------- Co-authored-by: Micah Maligie --- src/view/shell/Drawer.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/view/shell/Drawer.tsx') diff --git a/src/view/shell/Drawer.tsx b/src/view/shell/Drawer.tsx index 3379d0501..67092938e 100644 --- a/src/view/shell/Drawer.tsx +++ b/src/view/shell/Drawer.tsx @@ -64,8 +64,13 @@ export const DrawerContent = observer(function DrawerContentImpl() { const state = navigation.getState() store.shell.closeDrawer() if (isWeb) { - // @ts-ignore must be Home, Search, Notifications, or MyProfile - navigation.navigate(tab) + // 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}) + } else { + // @ts-ignore must be Home, Search, Notifications, or MyProfile + navigation.navigate(tab) + } } else { const tabState = getTabState(state, tab) if (tabState === TabState.InsideAtRoot) { -- cgit 1.4.1