diff options
Diffstat (limited to 'src/state/models/root-store.ts')
-rw-r--r-- | src/state/models/root-store.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/state/models/root-store.ts b/src/state/models/root-store.ts index 5a3d102aa..389ce86d8 100644 --- a/src/state/models/root-store.ts +++ b/src/state/models/root-store.ts @@ -135,8 +135,9 @@ export class RootStoreModel { /* dont await */ this.preferences.sync() await this.me.load() if (!hadSession) { - resetNavigation() + await resetNavigation() } + this.emitSessionReady() } /** @@ -195,6 +196,14 @@ export class RootStoreModel { DeviceEventEmitter.emit('session-loaded') } + // the session has completed all setup; good for post-initialization behaviors like triggering modals + onSessionReady(handler: () => void): EmitterSubscription { + return DeviceEventEmitter.addListener('session-ready', handler) + } + emitSessionReady() { + DeviceEventEmitter.emit('session-ready') + } + // the session was dropped due to bad/expired refresh tokens onSessionDropped(handler: () => void): EmitterSubscription { return DeviceEventEmitter.addListener('session-dropped', handler) |