From a748d190c44c924d8fc90b7deb3c14ab41481a65 Mon Sep 17 00:00:00 2001 From: EphemeralFog Date: Thu, 25 Jun 2026 11:15:41 +0330 Subject: [PATCH 1/3] fix: add account not working if hashRouter is enabled --- src/app/pages/client/sidebar/AccountSwitcherTab.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/pages/client/sidebar/AccountSwitcherTab.tsx b/src/app/pages/client/sidebar/AccountSwitcherTab.tsx index e46d427fe..bb1ff8b29 100644 --- a/src/app/pages/client/sidebar/AccountSwitcherTab.tsx +++ b/src/app/pages/client/sidebar/AccountSwitcherTab.tsx @@ -47,6 +47,7 @@ import { UnreadBadge, UnreadBadgeCenter } from '$components/unread-badge'; import { Check, chipIcon, GearSix, menuIcon, Plus } from '$components/icons/phosphor'; import { useSetting } from '$state/hooks/settings'; import { settingsAtom } from '$state/settings'; +import { usePathWithOrigin } from '$hooks/usePathWithOrigin'; const log = createLogger('AccountSwitcherTab'); @@ -179,6 +180,8 @@ export function AccountSwitcherTab({ isBottom }: { isBottom?: boolean }) { const { disableAccountSwitcher } = useClientConfig(); + const loginUrl = usePathWithOrigin(getLoginPath()); + const handleToggle: MouseEventHandler = (evt) => { if (disableAccountSwitcher) { openSettings(); @@ -245,7 +248,7 @@ export function AccountSwitcherTab({ isBottom }: { isBottom?: boolean }) { ); const handleAddAccount = () => { - const url = withSearchParam(getLoginPath(), { addAccount: '1' }); + const url = withSearchParam(loginUrl, { addAccount: '1' }); setMenuAnchor(undefined); stopClient(mx); setTimeout(() => window.location.assign(url), 100); From 36a0f9cc1acab1c2c608569dd069e2d9644713e3 Mon Sep 17 00:00:00 2001 From: EphemeralFog Date: Thu, 25 Jun 2026 11:15:51 +0330 Subject: [PATCH 2/3] fix: cancel button in the auth page not working when hash router is enabled --- src/app/pages/auth/AuthLayout.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/app/pages/auth/AuthLayout.tsx b/src/app/pages/auth/AuthLayout.tsx index 9a4cd8b85..3d725992e 100644 --- a/src/app/pages/auth/AuthLayout.tsx +++ b/src/app/pages/auth/AuthLayout.tsx @@ -30,6 +30,7 @@ import type { SpecVersions } from '../../cs-api'; import { ServerPicker } from './ServerPicker'; import * as css from './styles.css'; import { AuthFooter } from './AuthFooter'; +import { usePathWithOrigin } from '$hooks/usePathWithOrigin'; const currentAuthPath = (pathname: string): string => { if (matchPath(LOGIN_PATH, pathname)) { @@ -117,6 +118,8 @@ export function AuthLayout() { const clientConfig = useClientConfig(); + const homeUrl = usePathWithOrigin(getHomePath()); + const defaultServer = clientDefaultServer(clientConfig); const decodedServer = urlEncodedServer && decodeURIComponent(urlEncodedServer); let server: string = decodedServer ?? defaultServer; @@ -208,11 +211,7 @@ export function AuthLayout() { Adding account - window.location.assign(getHomePath())} - > + window.location.assign(homeUrl)}> Cancel From b26704da96efbf6e045476984deee2496c0bfe79 Mon Sep 17 00:00:00 2001 From: EphemeralFog Date: Thu, 25 Jun 2026 11:16:03 +0330 Subject: [PATCH 3/3] chore: add changeset --- .changeset/fix-hash-router-account-switcher-path.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fix-hash-router-account-switcher-path.md diff --git a/.changeset/fix-hash-router-account-switcher-path.md b/.changeset/fix-hash-router-account-switcher-path.md new file mode 100644 index 000000000..17f718f27 --- /dev/null +++ b/.changeset/fix-hash-router-account-switcher-path.md @@ -0,0 +1,5 @@ +--- +default: patch +--- + +Fix account switcher's add account button redirecting to the wrong path when hashRouter is enabled