summaryrefslogtreecommitdiff
path: root/ui/routes/(app)
diff options
context:
space:
mode:
Diffstat (limited to 'ui/routes/(app)')
-rw-r--r--ui/routes/(app)/ch/[channel]/+page.svelte12
1 files changed, 3 insertions, 9 deletions
diff --git a/ui/routes/(app)/ch/[channel]/+page.svelte b/ui/routes/(app)/ch/[channel]/+page.svelte
index dbdb507..d64a8c9 100644
--- a/ui/routes/(app)/ch/[channel]/+page.svelte
+++ b/ui/routes/(app)/ch/[channel]/+page.svelte
@@ -33,16 +33,10 @@
}
function setLastRead() {
- const channelObject = $channelsList.getChannel(channel);
const lastInView = getLastVisibleMessage();
- if (!channelObject || !lastInView) {
- return;
- }
- const at = DateTime.fromISO(lastInView.dataset.at);
- // Do it this way, rather than with Math.max tricks, to avoid assignment
- // when we don't need it, to minimize reactive changes:
- if (at > channelObject.lastReadAt) {
- channelObject.lastReadAt = at;
+ if (lastInView) {
+ const at = DateTime.fromISO(lastInView.dataset.at);
+ $channelsList.updateLastReadAt(channel, at);
}
}