Bluesky app fork with some witchin' additions 💫 witchsky.app
bluesky fork client

preserve URL when switching accounts #31

closed opened by koi.rip targeting main from koi.rip/witchsky.app: preserve-url-on-account-switch
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:b26ewgkrnx3yvsp2cdao3ntu/sh.tangled.repo.pull/3ma3qdhc7ut22
-9
Diff #0
-9
src/lib/hooks/useAccountSwitcher.ts
··· 3 3 import {useLingui} from '@lingui/react' 4 4 5 5 import {logger} from '#/logger' 6 - import {isWeb} from '#/platform/detection' 7 6 import {type SessionAccount, useSessionApi} from '#/state/session' 8 7 import {useLoggedOutViewControls} from '#/state/shell/logged-out' 9 8 import * as Toast from '#/view/com/util/Toast' ··· 28 27 try { 29 28 setPendingDid(account.did) 30 29 if (account.accessJwt) { 31 - if (isWeb) { 32 - // We're switching accounts, which remounts the entire app. 33 - // On mobile, this gets us Home, but on the web we also need reset the URL. 34 - // We can't change the URL via a navigate() call because the navigator 35 - // itself is about to unmount, and it calls pushState() too late. 36 - // So we change the URL ourselves. The navigator will pick it up on remount. 37 - history.pushState(null, '', '/') 38 - } 39 30 await resumeSession(account, true) 40 31 logEvent('account:loggedIn', {logContext, withPassword: false}) 41 32 Toast.show(_(msg`Signed in as @${account.handle}`))

History

1 round 0 comments
sign up or login to add to the discussion
koi.rip submitted #0
1 commit
expand
preserve URL when switching accounts
expand 0 comments
closed without merging