From 99d6f3fd76df5d633b34e847dfdf80327e716596 Mon Sep 17 00:00:00 2001 From: Josh Creek <8179928+jcreek@users.noreply.github.com> Date: Thu, 4 Apr 2024 12:10:33 +0100 Subject: [PATCH] fix(*): Prevent showing new users all previous change logs --- src/routes/estimation/[roomId]/+page.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/estimation/[roomId]/+page.svelte b/src/routes/estimation/[roomId]/+page.svelte index 7c6c5c1..c7e3441 100644 --- a/src/routes/estimation/[roomId]/+page.svelte +++ b/src/routes/estimation/[roomId]/+page.svelte @@ -20,8 +20,8 @@ // Get the user's last visit timestamp from localStorage let lastVisitTimestamp = localStorage.getItem('lastVisitTimestamp'); - // If lastVisitTimestamp is null or undefined, set it to 0 - lastVisitTimestamp = lastVisitTimestamp ? lastVisitTimestamp : '0'; + // If lastVisitTimestamp is null or undefined, set it to today's date + lastVisitTimestamp = lastVisitTimestamp ? lastVisitTimestamp : new Date().toISOString(); // Filter changes made after the user's last visit newChanges = changesLog.filter((change) => change.timestamp > lastVisitTimestamp);