Get more rigorous about getAgent() consistency (#2026)
* Get more rigorous about getAgent() consistency * Update the feed wrapper API to use getAgent() directly
This commit is contained in:
@@ -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),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user