fix inaccessible space on alias change

This commit is contained in:
Ajay Bura 2025-06-10 08:29:33 +05:30
parent e6f4eeca8e
commit d086eddacf

View file

@ -744,13 +744,14 @@ export function SpaceTabs({ scrollRef }: SpaceTabsProps) {
const targetSpaceId = target.getAttribute('data-id'); const targetSpaceId = target.getAttribute('data-id');
if (!targetSpaceId) return; if (!targetSpaceId) return;
const spacePath = getSpacePath(getCanonicalAliasOrRoomId(mx, targetSpaceId));
if (screenSize === ScreenSize.Mobile) { if (screenSize === ScreenSize.Mobile) {
navigate(getSpacePath(getCanonicalAliasOrRoomId(mx, targetSpaceId))); navigate(spacePath);
return; return;
} }
const activePath = navToActivePath.get(targetSpaceId); const activePath = navToActivePath.get(targetSpaceId);
if (activePath) { if (activePath && activePath.pathname.startsWith(spacePath)) {
navigate(joinPathComponent(activePath)); navigate(joinPathComponent(activePath));
return; return;
} }