about summary refs log tree commit diff
path: root/src/state/queries/preferences/index.ts
diff options
context:
space:
mode:
authorHailey <me@haileyok.com>2024-08-12 14:00:15 -0700
committerGitHub <noreply@github.com>2024-08-12 14:00:15 -0700
commit7df2327424e948e54b9731e5ab651e889f38a772 (patch)
treecd6513394de29696124374d1a72bd4cd78cbc1a7 /src/state/queries/preferences/index.ts
parentae883e2df7bc53baca215fba527fe113e71cb5c2 (diff)
downloadvoidsky-7df2327424e948e54b9731e5ab651e889f38a772.tar.zst
Upgrade API, implement XRPC rework (#4857)
Co-authored-by: Matthieu Sieben <matthieu.sieben@gmail.com>
Diffstat (limited to 'src/state/queries/preferences/index.ts')
-rw-r--r--src/state/queries/preferences/index.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/state/queries/preferences/index.ts b/src/state/queries/preferences/index.ts
index 6991f8647..ab866d5e2 100644
--- a/src/state/queries/preferences/index.ts
+++ b/src/state/queries/preferences/index.ts
@@ -37,14 +37,14 @@ export function usePreferencesQuery() {
     refetchOnWindowFocus: true,
     queryKey: preferencesQueryKey,
     queryFn: async () => {
-      if (agent.session?.did === undefined) {
+      if (!agent.did) {
         return DEFAULT_LOGGED_OUT_PREFERENCES
       } else {
         const res = await agent.getPreferences()
 
         // save to local storage to ensure there are labels on initial requests
         saveLabelers(
-          agent.session.did,
+          agent.did,
           res.moderationPrefs.labelers.map(l => l.did),
         )