asdkjlfhlaskjdhf

This commit is contained in:
2026-03-11 01:20:31 -04:00
parent 2fea81d46b
commit 3160d96c15
5 changed files with 25 additions and 58 deletions

View File

@@ -1,7 +1,3 @@
// Simple notification helpers for the chat client.
const APP_NAME = "COMS";
function supportsNotifications() {
return typeof Notification !== "undefined";
}
@@ -12,9 +8,6 @@ function stripHtml(input) {
return div.textContent || div.innerText || "";
}
/**
* Ask for permission if not already granted/denied.
*/
function primeNotifications() {
if (!supportsNotifications()) return;
if (Notification.permission === "default") {
@@ -34,14 +27,10 @@ function showNotification(title, body) {
}
}
/**
* Notify the user of a system notice.
* @param {string} content - HTML or text content of the notice.
*/
function notifyNotice(content) {
const text = stripHtml(content);
if (!text) return;
showNotification(`${APP_NAME} notice`, text);
showNotification(`COMS`, text);
}
/**
@@ -53,7 +42,7 @@ function notifyDirectReply(authorName, content) {
const text = stripHtml(content);
if (!text) return;
const name = authorName || "Anon";
showNotification(`${name} replied to your thread`, text);
showNotification(`${name} replied`, text);
}
export { primeNotifications, notifyNotice, notifyDirectReply };