From fa4b562fcc0fa8a33b58de0984973e2c5b13f1ef Mon Sep 17 00:00:00 2001 From: nmemmert <67961292+nmemmert@users.noreply.github.com> Date: Thu, 22 Oct 2026 14:41:56 -0400 Subject: [PATCH] Reminders: Clear all notifications on this device Co-Authored-By: Claude Sonnet 5.5 --- public/reminders.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/public/reminders.js b/public/reminders.js index 27bdd7a..8fbb588 100644 --- a/public/reminders.js +++ b/public/reminders.js @@ -23,7 +23,8 @@ async function remindersInit() {
Morning time
` : ''} ${allowed('calendar') ? `
How early
` : ''} -
Send a test to every device that is on
`; +
Send a test to every device that is on
+
Dismiss every notification from NE Hub still showing on this device
`; const on1 = document.getElementById('remon'); on1.onchange = async () => { try { @@ -42,5 +43,12 @@ async function remindersInit() { }; const pref = (id, key, get) => { const el = document.getElementById(id); if (el) el.onchange = () => post('prefs', { [key]: get(el) }).catch(e => toast(e.message)); }; pref('remt', 'tasks', e => e.checked); pref('remat', 'tasksAt', e => e.value); pref('reme', 'events', e => e.checked); pref('remm', 'eventMins', e => +e.value); + document.getElementById('remclear').onclick = async () => { + try { + const list = await reg.getNotifications(); list.forEach(n => n.close()); + try { navigator.clearAppBadge && await navigator.clearAppBadge(); } catch {} + toast(list.length ? 'Cleared ' + list.length + (list.length === 1 ? ' notification' : ' notifications') : 'No notifications to clear'); + } catch (e) { toast(e.message); } + }; document.getElementById('remtest').onclick = () => post('test', {}).then(() => toast('Test sent')).catch(e => toast(e.message)); }