#37 Implement v1 Web Apps #41

Merged
logan merged 58 commits from #37-implement-webapps into master 2023-08-04 23:46:50 -04:00
2 changed files with 18 additions and 14 deletions
Showing only changes of commit ec091c0017 - Show all commits

View File

@@ -30,6 +30,7 @@ function addToastToStorage(time, message) {
var toasts = [{ 'time': time, 'message': message }] var toasts = [{ 'time': time, 'message': message }]
var storedToasts = getStoredToasts(); var storedToasts = getStoredToasts();
console.log("Adding new notification to storage: ", toasts); console.log("Adding new notification to storage: ", toasts);
if (storedToasts) {
toasts = toasts.concat(storedToasts); toasts = toasts.concat(storedToasts);
console.log("Combined new and stored notifications: ", toasts); console.log("Combined new and stored notifications: ", toasts);
toasts = toasts.filter((value, index, self) => toasts = toasts.filter((value, index, self) =>
@@ -37,6 +38,7 @@ function addToastToStorage(time, message) {
t.time === value.time && t.message === value.message t.time === value.time && t.message === value.message
)) ))
) )
}
console.log("Deduped stored notifications: ", toasts); console.log("Deduped stored notifications: ", toasts);
localStorage.setItem("toasts", JSON.stringify(toasts)); localStorage.setItem("toasts", JSON.stringify(toasts));
navbarUpdateNotificationBellCount(toasts); navbarUpdateNotificationBellCount(toasts);

View File

@@ -30,6 +30,7 @@ function addToastToStorage(time, message) {
var toasts = [{ 'time': time, 'message': message }] var toasts = [{ 'time': time, 'message': message }]
var storedToasts = getStoredToasts(); var storedToasts = getStoredToasts();
console.log("Adding new notification to storage: ", toasts); console.log("Adding new notification to storage: ", toasts);
if (storedToasts) {
toasts = toasts.concat(storedToasts); toasts = toasts.concat(storedToasts);
console.log("Combined new and stored notifications: ", toasts); console.log("Combined new and stored notifications: ", toasts);
toasts = toasts.filter((value, index, self) => toasts = toasts.filter((value, index, self) =>
@@ -37,6 +38,7 @@ function addToastToStorage(time, message) {
t.time === value.time && t.message === value.message t.time === value.time && t.message === value.message
)) ))
) )
}
console.log("Deduped stored notifications: ", toasts); console.log("Deduped stored notifications: ", toasts);
localStorage.setItem("toasts", JSON.stringify(toasts)); localStorage.setItem("toasts", JSON.stringify(toasts));
navbarUpdateNotificationBellCount(toasts); navbarUpdateNotificationBellCount(toasts);