diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2025-05-16 20:36:56 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2025-05-16 20:36:56 -0400 |
| commit | b3fcd627ae57cd0587363eaf2d5f4635a82bda60 (patch) | |
| tree | 67cebc5ec6275bc54f710c77921027a45c2a20a6 /ui/lib/session.svelte.js | |
| parent | 4e8cfb5f37b607382fb80e012133dd372aa4ec36 (diff) | |
| parent | 666321324bf8fc7313a5ba73234fc40712fdeaa0 (diff) | |
Merge branch 'prop/unread-channels'
Diffstat (limited to 'ui/lib/session.svelte.js')
| -rw-r--r-- | ui/lib/session.svelte.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ui/lib/session.svelte.js b/ui/lib/session.svelte.js index 2dae3c4..432fad2 100644 --- a/ui/lib/session.svelte.js +++ b/ui/lib/session.svelte.js @@ -7,14 +7,13 @@ import * as r from './state/remote/state.svelte.js'; import * as l from './state/local/channels.svelte.js'; import { Watchdog } from './watchdog.js'; import { DateTime } from 'luxon'; -import { render } from '$lib/markdown.js'; class Channel { static fromRemote({ at, id, name }, messages, meta) { const sentAt = messages .filter((message) => message.channel === id) .map((message) => message.at); - const lastEventAt = Math.max(at, ...sentAt); + const lastEventAt = DateTime.max(at, ...sentAt); const lastReadAt = meta.get(id)?.lastReadAt; const hasUnreads = lastReadAt === undefined || lastEventAt > lastReadAt; @@ -114,7 +113,7 @@ class Session { onMessage(message) { const event = JSON.parse(message.data); this.remote.onEvent(event); - this.local.retainChannels(this.remote.channels.all.keys()); + this.local.retainChannels(this.remote.channels.all); this.watchdog.reset(this.heartbeatMillis()); } |
