Log even more garbage
Test / test (push) Failing after 54s
Details
Test / test (push) Failing after 54s
Details
This commit is contained in:
parent
3ff16c58b2
commit
121cc90de9
|
|
@ -100,7 +100,6 @@ export default function start(self: ServiceWorkerGlobalScope) {
|
|||
})()
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
async function submitSubscription(
|
||||
registration: ServiceWorkerRegistration,
|
||||
|
|
@ -108,10 +107,18 @@ async function submitSubscription(
|
|||
) {
|
||||
const db = database()
|
||||
|
||||
await sendMessage({
|
||||
message: `Is subscription null? ${subscription === null}`,
|
||||
})
|
||||
|
||||
if (subscription === null) return
|
||||
|
||||
const existingSubscriptionId = await db.subscriptions.get(1)
|
||||
|
||||
await sendMessage({
|
||||
message: `Existing subscription ID ${existingSubscriptionId}`,
|
||||
})
|
||||
|
||||
const applicationServerKey = urlB64ToUint8Array(pushPublicKey)
|
||||
const newSubscription = await registration.pushManager.subscribe({
|
||||
userVisibleOnly: true,
|
||||
|
|
@ -134,6 +141,10 @@ async function postSubscription(
|
|||
body: JSON.stringify(subscription),
|
||||
})
|
||||
|
||||
await sendMessage({
|
||||
message: `Response status ${response.status}`,
|
||||
})
|
||||
|
||||
db.subscriptions.put({
|
||||
id: 1,
|
||||
subscriptionId: (await response.json()).subscriptionId,
|
||||
|
|
@ -146,6 +157,7 @@ function putSubscription(subscription: PushSubscription, id: number) {
|
|||
body: JSON.stringify(subscription),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function database() {
|
||||
const db = new Dexie("tack-up-now", { indexedDB }) as Dexie & {
|
||||
|
|
|
|||
Loading…
Reference in New Issue