about summary refs log tree commit diff
path: root/src/storage
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2025-02-03 14:22:49 -0600
committerGitHub <noreply@github.com>2025-02-03 14:22:49 -0600
commit25991af7224cd76a8722f0579c00b73a211a84cc (patch)
treefbb0fc3d622c92becdd1e0bab37cacc7887e014d /src/storage
parentd0ff6dcba0af82795d101021e76df701e51728e9 (diff)
downloadvoidsky-25991af7224cd76a8722f0579c00b73a211a84cc.tar.zst
Add example account store (#7641)
* Add example account store

* Format
Diffstat (limited to 'src/storage')
-rw-r--r--src/storage/index.ts9
-rw-r--r--src/storage/schema.ts4
2 files changed, 12 insertions, 1 deletions
diff --git a/src/storage/index.ts b/src/storage/index.ts
index ce17d4c36..8ec09eefa 100644
--- a/src/storage/index.ts
+++ b/src/storage/index.ts
@@ -1,6 +1,7 @@
 import {MMKV} from 'react-native-mmkv'
+import {Did} from '@atproto/api'
 
-import {Device} from '#/storage/schema'
+import {Account, Device} from '#/storage/schema'
 
 export * from '#/storage/schema'
 
@@ -73,9 +74,15 @@ export class Storage<Scopes extends unknown[], Schema> {
  */
 export const device = new Storage<[], Device>({id: 'bsky_device'})
 
+/**
+ * Account data that's specific to the account on this device
+ */
+export const account = new Storage<[Did], Account>({id: 'bsky_account'})
+
 if (__DEV__ && typeof window !== 'undefined') {
   // @ts-ignore
   window.bsky_storage = {
     device,
+    account,
   }
 }
diff --git a/src/storage/schema.ts b/src/storage/schema.ts
index cfca9131c..d8b9874e4 100644
--- a/src/storage/schema.ts
+++ b/src/storage/schema.ts
@@ -10,3 +10,7 @@ export type Device = {
   }
   trendingBetaEnabled: boolean
 }
+
+export type Account = {
+  searchTermHistory?: string[]
+}