Don't check unread if session doesn't exist (#2008)
parent
26bbe07068
commit
a741a201b9
|
@ -70,8 +70,12 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
|
||||||
},
|
},
|
||||||
|
|
||||||
async checkUnread() {
|
async checkUnread() {
|
||||||
|
const agent = getAgent()
|
||||||
|
|
||||||
|
if (!agent.session) return
|
||||||
|
|
||||||
// count
|
// count
|
||||||
const res = await getAgent().listNotifications({limit: 40})
|
const res = await agent.listNotifications({limit: 40})
|
||||||
const filtered = res.data.notifications.filter(
|
const filtered = res.data.notifications.filter(
|
||||||
notif => !notif.isRead && !shouldFilterNotif(notif, moderationOpts),
|
notif => !notif.isRead && !shouldFilterNotif(notif, moderationOpts),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue