about summary refs log tree commit diff
path: root/src/state/models/root-store.ts
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2022-06-09 17:13:29 -0500
committerPaul Frazee <pfrazee@gmail.com>2022-06-09 17:13:29 -0500
commit802222fe7181303d710607129e1c74427f07c97c (patch)
tree169b0878ed5d60f511fcf188df5118c0f446a37d /src/state/models/root-store.ts
parentfc3b2952bb59b80665ebb53ffb3377f647ccdbd3 (diff)
downloadvoidsky-802222fe7181303d710607129e1c74427f07c97c.tar.zst
Add auth navigations
Diffstat (limited to 'src/state/models/root-store.ts')
-rw-r--r--src/state/models/root-store.ts11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/state/models/root-store.ts b/src/state/models/root-store.ts
index 164dfcced..143c59ea1 100644
--- a/src/state/models/root-store.ts
+++ b/src/state/models/root-store.ts
@@ -4,12 +4,21 @@
 
 import {Instance, SnapshotOut, types} from 'mobx-state-tree'
 import {createContext, useContext} from 'react'
+import {SessionModel, createDefaultSession} from './session'
 
-export const RootStoreModel = types.model('RootStore').props({})
+export const RootStoreModel = types.model('RootStore').props({
+  session: SessionModel,
+})
 
 export interface RootStore extends Instance<typeof RootStoreModel> {}
 export interface RootStoreSnapshot extends SnapshotOut<typeof RootStoreModel> {}
 
+export function createDefaultRootStore() {
+  return {
+    session: createDefaultSession(),
+  }
+}
+
 // react context & hook utilities
 const RootStoreContext = createContext<RootStore>({} as RootStore)
 export const RootStoreProvider = RootStoreContext.Provider