diff options
| author | Adam Soltys <[email protected]> | 2026-08-30 21:34:41 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-30 21:34:41 -0700 |
| commit | 74490be0d54f2e1587b45acd28bd5f95668ef7e0 (patch) | |
| tree | e74a2457dea1f97c1cbbda335899656654551f91 /src/features | |
| parent | 24a7ca81e58e4cc4b54d658fa5befc69f6a5498f (diff) | |
| download | coinosv3-74490be0d54f2e1587b45acd28bd5f95668ef7e0.tar.gz coinosv3-74490be0d54f2e1587b45acd28bd5f95668ef7e0.zip | |
The header dot stops arriving fashionably late on a brand-new account: the first-frame optimism keyed on 'no rooms yet', but init() creates the coinos room before the first paint, so the guard never fired and the dot waited for real messages to decrypt — it now keys on no messages having landed, which is what it meant all along
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MrkLsNScXe9b6BviUSdmMr
Diffstat (limited to 'src/features')
| -rw-r--r-- | src/features/messages.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/features/messages.js b/src/features/messages.js index 2249c8f..af22b8c 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -2641,11 +2641,16 @@ export function messagesFeature(ctx) { unreadMessages() { // A device with no read watermarks yet (a fresh restore or brand-new // wallet) will show the dot the moment the community messages land — - // which is always: the default community is never empty and read state - // is device-local. Paint it from the first frame instead of popping it - // in when the fetch returns. + // which is always: the default community is never empty, the welcome + // DM is on its way, and read state is device-local. Paint it from the + // first frame instead of popping it in when the fetch returns. NB the + // guard must key on "no MESSAGES landed yet", not "no rooms": init() + // creates the coinos room synchronously before the first paint, so a + // rooms.size check defeated the optimism it was written for. const s = st(); - if (!Object.keys(s.read || {}).length && !threads.size && !rooms.size) return 1; + const anyMsgs = threads.size > 0 + || [...rooms.values()].some((r) => [...r.byChannel.values()].some((m) => m.size)); + if (!Object.keys(s.read || {}).length && !anyMsgs) return 1; return unreadCount(); }, notifySettingsCards() { return [notifyCard()]; }, |
