feat: improve organization switching experience with a branded loading overlay and session management for smoother transitions
This commit is contained in:
@@ -33,8 +33,8 @@ export default function OrganizationSwitcher({ orgs, activeOrgId }: { orgs: Orga
|
||||
// * Note: switchContext only returns access_token, we keep existing refresh token
|
||||
await setSessionAction(access_token)
|
||||
|
||||
// Force reload to pick up new permissions
|
||||
window.location.reload()
|
||||
sessionStorage.setItem('pulse_switching_org', 'true')
|
||||
window.location.reload()
|
||||
|
||||
} catch (err) {
|
||||
console.error('Failed to switch organization', err)
|
||||
|
||||
@@ -419,10 +419,11 @@ export default function OrganizationSettings() {
|
||||
try {
|
||||
const { access_token } = await switchContext(null)
|
||||
await setSessionAction(access_token)
|
||||
sessionStorage.setItem('pulse_switching_org', 'true')
|
||||
window.location.href = '/'
|
||||
} catch (switchErr) {
|
||||
console.error('Failed to switch to personal context after delete:', switchErr)
|
||||
// Fallback: reload and let backend handle invalid token if any
|
||||
sessionStorage.setItem('pulse_switching_org', 'true')
|
||||
window.location.href = '/'
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user