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() +})