From b47e0f738e6084cf44eec478cc920703df155dd6 Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Mon, 14 Sep 2026 14:09:21 -0400 Subject: [PATCH] cal: upgrade to signed-in mode when auth lands after boot The piece checked handle()/user once in boot, but session:started usually arrives later, so a signed-in user saw the empty local store and no events. sim() now flips signedIn and refetches the range as soon as auth appears. Claude-Session: https://claude.ai/code/session_015WjRrR7a6QwSGFuatEQc2J --- system/public/aesthetic.computer/disks/cal.mjs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/system/public/aesthetic.computer/disks/cal.mjs b/system/public/aesthetic.computer/disks/cal.mjs index 297eeba450..33539cce19 100644 --- a/system/public/aesthetic.computer/disks/cal.mjs +++ b/system/public/aesthetic.computer/disks/cal.mjs @@ -104,7 +104,7 @@ function boot({ colon, store, net, handle, user, ui, screen }) { simClock = 0; frameCount = 0; - signedIn = !!(handle?.() || user); + signedIn = !!(handle?.() || user); // may still be false here; sim() upgrades const now = new Date(); today = { @@ -765,7 +765,14 @@ function focusAt(e, screen) { } // 🧮 Sim — keep "now" current so today's highlight survives a midnight rollover. -function sim() { +function sim({ handle, user }) { + // 🔐 Late sign-in: `session:started` can land after boot, so the boot-time + // check sees no user and we start in local mode. Upgrade once auth arrives. + if (!signedIn && (handle?.() || user)) { + signedIn = true; + fetchRange(); + } + simClock++; if (simClock >= 60 * 60) { simClock = 0; -- 2.51.2