From 6c93ed9c5ad0cea1940507d7e17d708491dcf771 Mon Sep 17 00:00:00 2001 From: Miodec Date: Fri, 14 Jan 2022 19:51:07 +0100 Subject: [PATCH] using new banners --- src/js/elements/new-version-notification.js | 10 +++------- src/js/elements/psa.js | 12 +++++++++--- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/js/elements/new-version-notification.js b/src/js/elements/new-version-notification.js index f8c8d7c31..833bf2d6d 100644 --- a/src/js/elements/new-version-notification.js +++ b/src/js/elements/new-version-notification.js @@ -23,15 +23,11 @@ export async function show(version) { } if (memory === version) return; caches.delete("sw-cache"); - Notifications.add( - `Version ${version} has been released. Click to view the changelog.`, + Notifications.addBanner( + `Version ${version} has been released. Click the version number in the bottom right to view the changelog.`, 1, - 5, - "Announcement", "code-branch", - () => { - VersionPopup.show(); - } + false ); setMemory(version); } diff --git a/src/js/elements/psa.js b/src/js/elements/psa.js index 5e3609d65..051817650 100644 --- a/src/js/elements/psa.js +++ b/src/js/elements/psa.js @@ -29,8 +29,14 @@ export async function show() { let localmemory = getMemory(); latest.forEach((psa) => { if (localmemory.includes(psa._id)) return; - Notifications.add(psa.message, -1, 0, "Announcement", "bullhorn", () => { - setMemory(psa._id); - }); + Notifications.addBanner( + psa.message, + psa.level, + "bullhorn", + psa.sticky, + () => { + setMemory(psa._id); + } + ); }); }