Changeset e61c289 in Klonkt for src/services/PushService.js
- Timestamp:
- 07/24/2026 05:03:34 PM (7 weeks ago)
- Branches:
- main
- Children:
- 318d0c2
- Parents:
- 6b5d7da
- File:
-
- 1 edited
-
src/services/PushService.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/PushService.js
r6b5d7da re61c289 68 68 // ── Subscriptions ─────────────────────────────────────────────────── 69 69 70 export const DEFAULT_ALERTS = { follow: 1, reply: 1, like: 0, boost: 0, dm: 1 }; 70 // help (a ward's call for help) and guardian (adoption handshake) serve the 71 // Guardian PWA and default ON: a guardian must never miss a call for help. 72 export const DEFAULT_ALERTS = { follow: 1, reply: 1, like: 0, boost: 0, dm: 1, help: 1, guardian: 1 }; 71 73 72 74 export function saveSubscription({ endpoint, userId, p256dh, auth, alertTypes, uaLabel }) { … … 122 124 // (the events themselves are still in Berichten — only the ping is deduped). 123 125 // In-memory is fine: one process, and a restart just means one extra ping. 124 const THROTTLE_SECONDS = { follow: 60, reply: 30, dm: 30, like: 300, boost: 300, test: 0 };126 const THROTTLE_SECONDS = { follow: 60, reply: 30, dm: 30, like: 300, boost: 300, test: 0, help: 0, guardian: 30 }; 125 127 const _lastPush = new Map(); 126 128 export function throttled(userId, type, nowSeconds = Math.floor(Date.now() / 1000)) { … … 135 137 136 138 // Notify one user on all their devices, honouring per-type preferences. 137 // type ∈ {follow, reply, like, boost, dm, test}. Fire-and-forget at call sites.139 // type ∈ {follow, reply, like, boost, dm, help, guardian, test}. Fire-and-forget at call sites. 138 140 export async function notifyUser(userId, { type, title, body, url }) { 139 141 if (!(await pushReady())) return 0;
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)