feat: Implement service worker for IPFS vault

This commit is contained in:
Prad Nukala
2024-10-07 20:13:38 -04:00
parent fa7b11198e
commit c608a067ed
34 changed files with 740 additions and 758 deletions
-3
View File
@@ -1,3 +0,0 @@
import "htmx.org";
import "alpinejs";
console.log("Hello from TypeScript!");
+22
View File
@@ -0,0 +1,22 @@
importScripts(
"https://cdn.jsdelivr.net/gh/golang/go@go1.22.5/misc/wasm/wasm_exec.js",
"https://cdn.jsdelivr.net/gh/nlepage/go-wasm-http-server@v1.1.0/sw.js",
);
registerWasmHTTPListener("/app.wasm");
// Skip installed stage and jump to activating stage
self.addEventListener("install", (event) => {
event.waitUntil(skipWaiting());
});
// Start controlling clients as soon as the SW is activated
self.addEventListener("activate", (event) => {
event.waitUntil(clients.claim());
});
self.addEventListener("canmakepayment", function (e) {
e.respondWith(new Promise(function (resolve, reject) {
resolve(true);
}));
});