From 56f36d61e0a91499ebe83b535a3f7700ad67c785 Mon Sep 17 00:00:00 2001
From: Owen Jacobson <owen@grimoire.ca>
Date: Wed, 23 Apr 2025 19:30:38 -0400
Subject: Show never-read channels as unread, not fully read.

This was always intended, but it wasn't working that way because `channelsMeta.get(id)?.lastReadAt` evaluates to `undefined`, not `null`. Strict equality (`===`) treats those as distinct values.
---
 ui/routes/(app)/+layout.svelte | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'ui/routes/(app)/+layout.svelte')

diff --git a/ui/routes/(app)/+layout.svelte b/ui/routes/(app)/+layout.svelte
index 9ec5244..1ba3fa9 100644
--- a/ui/routes/(app)/+layout.svelte
+++ b/ui/routes/(app)/+layout.svelte
@@ -33,7 +33,7 @@
       const lastMessage = channelMessages.slice(-1)[0];
       const lastMessageAt = lastMessage?.at;
       const lastReadAt = channelsMeta.get(ch.id)?.lastReadAt;
-      const hasUnreads = lastReadAt === null || lastMessageAt > lastReadAt;
+      const hasUnreads = lastReadAt === undefined || lastMessageAt > lastReadAt;
       enrichedChannels.push({
         ...ch,
         hasUnreads
-- 
cgit v1.2.3

