about summary refs log tree commit diff
path: root/src/state/queries/notifications/unread.tsx
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-11-29 10:10:04 -0800
committerGitHub <noreply@github.com>2023-11-29 10:10:04 -0800
commit6fe2b52f6860916a62bf9a4d680a0a3b91b50d91 (patch)
tree92da7f206d6945752e149a2f1af8bbb31773efec /src/state/queries/notifications/unread.tsx
parent9fb2c29c672f6be07410ae1ca4d7e47b6c98f914 (diff)
downloadvoidsky-6fe2b52f6860916a62bf9a4d680a0a3b91b50d91.tar.zst
Get more rigorous about getAgent() consistency (#2026)
* Get more rigorous about getAgent() consistency

* Update the feed wrapper API to use getAgent() directly
Diffstat (limited to 'src/state/queries/notifications/unread.tsx')
-rw-r--r--src/state/queries/notifications/unread.tsx6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/state/queries/notifications/unread.tsx b/src/state/queries/notifications/unread.tsx
index 36bc6528f..b93e1dc81 100644
--- a/src/state/queries/notifications/unread.tsx
+++ b/src/state/queries/notifications/unread.tsx
@@ -70,12 +70,10 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
       },
 
       async checkUnread() {
-        const agent = getAgent()
-
-        if (!agent.session) return
+        if (!getAgent().session) return
 
         // count
-        const res = await agent.listNotifications({limit: 40})
+        const res = await getAgent().listNotifications({limit: 40})
         const filtered = res.data.notifications.filter(
           notif => !notif.isRead && !shouldFilterNotif(notif, moderationOpts),
         )