diff options
| author | Kit La Touche <kit@transneptune.net> | 2025-08-29 14:22:09 -0400 |
|---|---|---|
| committer | Kit La Touche <kit@transneptune.net> | 2025-08-29 14:22:09 -0400 |
| commit | ce00aa3965befe4b11a2115b704f96fd3559b19c (patch) | |
| tree | f1a034ac4d1a46b78cf04b4cc312cb953dcd0b50 /ui/lib/apiServer.js | |
| parent | 39282cf5d9494290a674a01a3f1f8172badcb16e (diff) | |
Make test-notifs button in settings
The idea here is that we should make a really really minimal
notifications feature, where you can enable them, and test them, but
nothing on the server will automatically send them.
Once that's in, we can add client-side config, which we'll need to sync
to the server and act on, that says:
> generally, notify me:
> 1. Not at all
> 2. When my name is mentioned
> 3. When any message arrives
> For each channel, override the above with one of the same three
> options.
Later later, we might want to also add "notify me when a new channel is
made".
Diffstat (limited to 'ui/lib/apiServer.js')
| -rw-r--r-- | ui/lib/apiServer.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ui/lib/apiServer.js b/ui/lib/apiServer.js index ac707a5..63fd8f9 100644 --- a/ui/lib/apiServer.js +++ b/ui/lib/apiServer.js @@ -55,6 +55,22 @@ export async function acceptInvite(inviteId, name, password) { .catch(responseError); } +export async function createPushSubscription(data) { + return await apiServer + .post("/push", { data }) + .catch(responseError); +} + +export async function deletePushSubscription(data) { + return await apiServer + .delete("/push", { data }) + .catch(responseError); +} + +export async function notifyMe() { + return await apiServer.post('/notifyMe').catch(responseError); +} + export function subscribeToEvents(resumePoint) { const eventsUrl = apiServer.getUri({ url: '/events', |
