about summary refs log tree commit diff
path: root/src/view/shell
diff options
context:
space:
mode:
authorNicolas Borlet <75842491+NicolasBorlet@users.noreply.github.com>2025-02-21 20:39:57 +0100
committerGitHub <noreply@github.com>2025-02-21 11:39:57 -0800
commitcb85768e9c0e8885e824899fa6b9957cd5225771 (patch)
tree7454d13bc149c00cf301f7604f612a56aab702d6 /src/view/shell
parentca7116ec3b834644d89983b7f7f9ee63fe8f1aff (diff)
downloadvoidsky-cb85768e9c0e8885e824899fa6b9957cd5225771.tar.zst
fix: click on our profile when seeing someone's profile (#7732)
Co-authored-by: Stanislas Signoud <signez@stanisoft.net>
Co-authored-by: Hailey <me@haileyok.com>
Diffstat (limited to 'src/view/shell')
-rw-r--r--src/view/shell/bottom-bar/BottomBarWeb.tsx14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/view/shell/bottom-bar/BottomBarWeb.tsx b/src/view/shell/bottom-bar/BottomBarWeb.tsx
index da935c9fb..8e6d90cfe 100644
--- a/src/view/shell/bottom-bar/BottomBarWeb.tsx
+++ b/src/view/shell/bottom-bar/BottomBarWeb.tsx
@@ -240,18 +240,28 @@ const NavItem: React.FC<{
     }
     return getCurrentRoute(state)
   })
+
+  // Checks whether we're on someone else's profile
+  const isOnDifferentProfile =
+    currentRoute.name === 'Profile' &&
+    routeName === 'Profile' &&
+    (currentRoute.params as CommonNavigatorParams['Profile']).name !==
+      currentAccount?.handle
+
   const isActive =
     currentRoute.name === 'Profile'
       ? isTab(currentRoute.name, routeName) &&
         (currentRoute.params as CommonNavigatorParams['Profile']).name ===
-          currentAccount?.handle
+          (routeName === 'Profile'
+            ? currentAccount?.handle
+            : (currentRoute.params as CommonNavigatorParams['Profile']).name)
       : isTab(currentRoute.name, routeName)
 
   return (
     <Link
       href={href}
       style={[styles.ctrl, a.pb_lg]}
-      navigationAction="navigate"
+      navigationAction={isOnDifferentProfile ? 'push' : 'navigate'}
       aria-role="link"
       aria-label={routeName}
       accessible={true}>