Replace Web Push and its service worker with page notifications over SSE
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { get, put, subscribe, type AgentSession, type ByreEvent, type Focus, type InboxItem, type Project, type Snapshot, type Task, type TaskTab, type User } from "./api.js";
|
||||
import { notifyInbox } from "./notifications.js";
|
||||
|
||||
export type Topic =
|
||||
| "me"
|
||||
@@ -316,6 +317,9 @@ export function handleEvent(ev: ByreEvent): void {
|
||||
}
|
||||
break;
|
||||
case "inbox.created":
|
||||
notifyInbox(ev.payload as unknown as InboxItem);
|
||||
void loadInbox();
|
||||
break;
|
||||
case "inbox.updated":
|
||||
void loadInbox();
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user