Fix session hydration during load
parent
08d38c219d
commit
42d7dc1c6c
|
@ -23,12 +23,12 @@ export async function setupState() {
|
||||||
rootStore = new RootStoreModel(api)
|
rootStore = new RootStoreModel(api)
|
||||||
try {
|
try {
|
||||||
data = (await storage.load(ROOT_STATE_STORAGE_KEY)) || {}
|
data = (await storage.load(ROOT_STATE_STORAGE_KEY)) || {}
|
||||||
|
rootStore.log.debug('Initial hydrate', {hasSession: !!data.session})
|
||||||
rootStore.hydrate(data)
|
rootStore.hydrate(data)
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
rootStore.log.error('Failed to load state from storage', e)
|
rootStore.log.error('Failed to load state from storage', e)
|
||||||
}
|
}
|
||||||
|
|
||||||
rootStore.log.debug('Initial hydrate')
|
|
||||||
rootStore.session
|
rootStore.session
|
||||||
.connect()
|
.connect()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|
|
@ -88,6 +88,9 @@ export class RootStoreModel {
|
||||||
if (hasProp(v, 'onboard')) {
|
if (hasProp(v, 'onboard')) {
|
||||||
this.onboard.hydrate(v.onboard)
|
this.onboard.hydrate(v.onboard)
|
||||||
}
|
}
|
||||||
|
if (hasProp(v, 'session')) {
|
||||||
|
this.session.hydrate(v.session)
|
||||||
|
}
|
||||||
if (hasProp(v, 'shell')) {
|
if (hasProp(v, 'shell')) {
|
||||||
this.shell.hydrate(v.shell)
|
this.shell.hydrate(v.shell)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue