about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-01-03 11:08:39 -0600
committerPaul Frazee <pfrazee@gmail.com>2023-01-03 11:08:39 -0600
commit42d7dc1c6c7137854c07523f67937f3eea86346d (patch)
tree66f29f7236e079350e163a67950bbe4c1de31459 /src
parent08d38c219df4f005b6cd060b1df7292410fdcb8e (diff)
downloadvoidsky-42d7dc1c6c7137854c07523f67937f3eea86346d.tar.zst
Fix session hydration during load
Diffstat (limited to 'src')
-rw-r--r--src/state/index.ts2
-rw-r--r--src/state/models/root-store.ts3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/state/index.ts b/src/state/index.ts
index bc8a16949..5c8b50ef1 100644
--- a/src/state/index.ts
+++ b/src/state/index.ts
@@ -23,12 +23,12 @@ export async function setupState() {
   rootStore = new RootStoreModel(api)
   try {
     data = (await storage.load(ROOT_STATE_STORAGE_KEY)) || {}
+    rootStore.log.debug('Initial hydrate', {hasSession: !!data.session})
     rootStore.hydrate(data)
   } catch (e: any) {
     rootStore.log.error('Failed to load state from storage', e)
   }
 
-  rootStore.log.debug('Initial hydrate')
   rootStore.session
     .connect()
     .then(() => {
diff --git a/src/state/models/root-store.ts b/src/state/models/root-store.ts
index 5349f10d0..5646157cb 100644
--- a/src/state/models/root-store.ts
+++ b/src/state/models/root-store.ts
@@ -88,6 +88,9 @@ export class RootStoreModel {
       if (hasProp(v, 'onboard')) {
         this.onboard.hydrate(v.onboard)
       }
+      if (hasProp(v, 'session')) {
+        this.session.hydrate(v.session)
+      }
       if (hasProp(v, 'shell')) {
         this.shell.hydrate(v.shell)
       }