From f0877b8f66492340347aa5617d16087778410ce8 Mon Sep 17 00:00:00 2001 From: Xylight Date: Sat, 9 Mar 2024 11:30:09 -0800 Subject: [PATCH] fix: notification dot not working (for the final time) --- src/lib/auth.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/auth.ts b/src/lib/auth.ts index d69faf5e..c13045de 100644 --- a/src/lib/auth.ts +++ b/src/lib/auth.ts @@ -400,5 +400,11 @@ async function checkInbox() { } setInterval(checkInbox, 4 * 60 * 1000) -checkInbox() + +let prevId: number | undefined = -2 +profile.subscribe((p) => { + if (p?.id == prevId || !p?.user) return + prevId = p?.id + if (p.id != -1) checkInbox() +})