using new banners

This commit is contained in:
Miodec 2022-01-14 19:51:07 +01:00
parent 429f5de96e
commit 6c93ed9c5a
2 changed files with 12 additions and 10 deletions

View file

@ -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);
}

View file

@ -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);
}
);
});
}