Skip to content

Commit

Permalink
Don't check unread if session doesn't exist (#2008)
Browse files Browse the repository at this point in the history
  • Loading branch information
estrattonbailey authored Nov 28, 2023
1 parent 26bbe07 commit a741a20
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/state/queries/notifications/unread.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,12 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
},

async checkUnread() {
const agent = getAgent()

if (!agent.session) return

// count
const res = await getAgent().listNotifications({limit: 40})
const res = await agent.listNotifications({limit: 40})
const filtered = res.data.notifications.filter(
notif => !notif.isRead && !shouldFilterNotif(notif, moderationOpts),
)
Expand Down

0 comments on commit a741a20

Please sign in to comment.