diff options
-rw-r--r-- | src/state/models/root-store.ts | 9 | ||||
-rw-r--r-- | src/state/models/session.ts | 3 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/state/models/root-store.ts b/src/state/models/root-store.ts index 6f919a4bf..8cd23efcd 100644 --- a/src/state/models/root-store.ts +++ b/src/state/models/root-store.ts @@ -119,12 +119,17 @@ export class RootStoreModel { /** * Called by the session model. Refreshes session-oriented state. */ - async handleSessionChange(agent: BskyAgent) { + async handleSessionChange( + agent: BskyAgent, + {hadSession}: {hadSession: boolean}, + ) { this.log.debug('RootStoreModel:handleSessionChange') this.agent = agent this.me.clear() await this.me.load() - resetNavigation() + if (!hadSession) { + resetNavigation() + } } /** diff --git a/src/state/models/session.ts b/src/state/models/session.ts index 96e058c02..c36537601 100644 --- a/src/state/models/session.ts +++ b/src/state/models/session.ts @@ -158,11 +158,12 @@ export class SessionModel { */ async setActiveSession(agent: BskyAgent, did: string) { this._log('SessionModel:setActiveSession') + const hadSession = !!this.data this.data = { service: agent.service.toString(), did, } - await this.rootStore.handleSessionChange(agent) + await this.rootStore.handleSessionChange(agent, {hadSession}) } /** |