mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-06-05 12:34:34 +02:00
Add PWA, service worker and Web Push
- Use new notification request/opt-in flow for push - Implement unsubscribing - Implement muting - Implement emojis in title - Add iOS specific PWA warning - Don’t use websockets when web push is enabled - Fix duplicate notifications - Implement default web push setting - Implement changing subscription type - Implement web push subscription refresh - Implement web push notification click
This commit is contained in:
parent
733ef4664b
commit
ff5c854192
53 changed files with 4363 additions and 249 deletions
web/src/app
|
@ -1,12 +1,22 @@
|
|||
import sessionReplica from "./SessionReplica";
|
||||
|
||||
class Session {
|
||||
constructor(replica) {
|
||||
this.replica = replica;
|
||||
}
|
||||
|
||||
store(username, token) {
|
||||
localStorage.setItem("user", username);
|
||||
localStorage.setItem("token", token);
|
||||
|
||||
this.replica.store(username, token);
|
||||
}
|
||||
|
||||
reset() {
|
||||
localStorage.removeItem("user");
|
||||
localStorage.removeItem("token");
|
||||
|
||||
this.replica.reset();
|
||||
}
|
||||
|
||||
resetAndRedirect(url) {
|
||||
|
@ -27,5 +37,5 @@ class Session {
|
|||
}
|
||||
}
|
||||
|
||||
const session = new Session();
|
||||
const session = new Session(sessionReplica);
|
||||
export default session;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue