fix(*): Prevent showing new users all previous change logs

This commit is contained in:
Josh Creek
2024-04-04 12:10:33 +01:00
parent ec7b111699
commit 99d6f3fd76
+2 -2
View File
@@ -20,8 +20,8 @@
// Get the user's last visit timestamp from localStorage // Get the user's last visit timestamp from localStorage
let lastVisitTimestamp = localStorage.getItem('lastVisitTimestamp'); let lastVisitTimestamp = localStorage.getItem('lastVisitTimestamp');
// If lastVisitTimestamp is null or undefined, set it to 0 // If lastVisitTimestamp is null or undefined, set it to today's date
lastVisitTimestamp = lastVisitTimestamp ? lastVisitTimestamp : '0'; lastVisitTimestamp = lastVisitTimestamp ? lastVisitTimestamp : new Date().toISOString();
// Filter changes made after the user's last visit // Filter changes made after the user's last visit
newChanges = changesLog.filter((change) => change.timestamp > lastVisitTimestamp); newChanges = changesLog.filter((change) => change.timestamp > lastVisitTimestamp);