Skip to content

Commit

Permalink
Deploying to gh-pages from @ 437e4e1 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanMillett committed Nov 8, 2024
1 parent 77d5449 commit 520fdd9
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 6 deletions.
Binary file modified _framework/Vetra.pdb.gz
Binary file not shown.
Binary file modified _framework/Vetra.wasm
Binary file not shown.
Binary file modified _framework/Vetra.wasm.br
Binary file not shown.
Binary file modified _framework/Vetra.wasm.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions _framework/blazor.boot.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"mainAssemblyName": "Vetra",
"resources": {
"hash": "sha256-wKEMvDdt3ME7cKrG1YrX9gbBxLjrnIZPVr4qkLtgBfc=",
"hash": "sha256-5ucNK81fMyhv34SIZYbAhurHi9fIOOEm8AwFDlnp6pM=",
"jsModuleNative": {
"dotnet.native.8.0.4.6vlmefabfv.js": "sha256-ju0+XWE0ihz554eKEj0HQ8Opa61xpbUIaX5/MNo8we4="
},
Expand Down Expand Up @@ -62,7 +62,7 @@
"System.Text.RegularExpressions.wasm": "sha256-fMlsAIWI7ksZUt3cJQke29givVX1ABFxYllg74MQMQY=",
"System.Threading.wasm": "sha256-WZ67IkKnMZXsZBKgPij/Wue9KklRaZeRmmjEHdtkPKo=",
"System.wasm": "sha256-j40bDq1kzFWVIkWKSn7zhVhRD7pPJwcCQwpWvGrmz9A=",
"Vetra.wasm": "sha256-HUhKcCGwD4eQQiTs3Ds6WIMIzSrw7r7nrxrVcQQhFqA="
"Vetra.wasm": "sha256-UMCOi6owUtGprdSdTk7Ewo0UsGNiTfLhvnnkmzr+dN4="
}
},
"cacheBootResources": true,
Expand Down
Binary file modified _framework/blazor.boot.json.br
Binary file not shown.
Binary file modified _framework/blazor.boot.json.gz
Binary file not shown.
32 changes: 28 additions & 4 deletions js/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,15 @@ async function updateNotificationStatus(staySubscribed)
{
const registration = await navigator.serviceWorker.register('service-worker.js');

const subscription = await registration.pushManager.subscribe({
userVisibleOnly: true,
applicationServerKey: 'BBIS4Xi3mCa3vxm7ymp5TWVgYhlTEMgf7vr1cn1eMsz3akiJ1WLIvA538FyJN4tTtBqKrTmu0t6McyZ6ISnY_qQ' // replace with your actual VAPID public key
});
let subscription = await registration.pushManager.getSubscription();

if (!subscription)
{
const subscription = await registration.pushManager.subscribe({
userVisibleOnly: true,
applicationServerKey: 'BBIS4Xi3mCa3vxm7ymp5TWVgYhlTEMgf7vr1cn1eMsz3akiJ1WLIvA538FyJN4tTtBqKrTmu0t6McyZ6ISnY_qQ'
});
}

const p256dh = subscription.getKey('p256dh');
const auth = subscription.getKey('auth');
Expand Down Expand Up @@ -107,3 +112,22 @@ async function updateNotificationStatus(staySubscribed)
}
}
}

async function getEndpoint()
{
if ('serviceWorker' in navigator && 'PushManager' in window)
{
const registration = await navigator.serviceWorker.register('service-worker.js');

let subscription = await registration.pushManager.getSubscription();

if (!subscription)
return "";

const endpoint = subscription.endpoint;

return endpoint.toString();
}

return "";
}

0 comments on commit 520fdd9

Please sign in to comment.