From 5741b9fee2153ce228cf7e6780e6837694dd1110 Mon Sep 17 00:00:00 2001 From: Jeff Date: Sat, 12 Oct 2024 15:08:40 -0400 Subject: [PATCH] Fix jsonification of message, try sending reply immediately upon receiving message event --- app/routes/_index.tsx | 2 +- app/worker.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/routes/_index.tsx b/app/routes/_index.tsx index 4d25ada..dfa7a1f 100644 --- a/app/routes/_index.tsx +++ b/app/routes/_index.tsx @@ -106,7 +106,7 @@ function TackUpNow({ {() => ( <> {messages.map((message, index) => ( -
JSON.stringify(message)
+
{JSON.stringify(message)}
))} {isInstalled ? (
Your Notifications
diff --git a/app/worker.ts b/app/worker.ts index 254bb67..40c5981 100644 --- a/app/worker.ts +++ b/app/worker.ts @@ -52,6 +52,10 @@ export default function start(self: ServiceWorkerGlobalScope) { const waitEvent = event as ExtendableEvent waitEvent.waitUntil( (async () => { + await sendMessage({ + message: "Got message", + }) + if ( "type" in event && event.type === "subscribed" &&