aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-12-02 13:19:13 -0800
committerAdam Soltys <[email protected]>2024-12-02 13:19:13 -0800
commit2f54bd38f33ddf47a9a235a25db1db59af554c82 (patch)
tree2502b8182920bd573b58c4787084debb6bf66a20
parent1c19697e3d22092e4518b12ecd03cff6a5c20ab4 (diff)
downloadcoinos-ui-2f54bd38f33ddf47a9a235a25db1db59af554c82.tar.gz
coinos-ui-2f54bd38f33ddf47a9a235a25db1db59af554c82.zip
don't serve offline api requests
-rw-r--r--src/service-worker.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/service-worker.js b/src/service-worker.js
index 5db8abb3..63e69008 100644
--- a/src/service-worker.js
+++ b/src/service-worker.js
@@ -37,6 +37,11 @@ self.addEventListener("fetch", (event) => {
const url = new URL(event.request.url);
const cache = await caches.open(CACHE);
+ if (url.pathname.startsWith("/api")) {
+ // Allow the network to handle these requests
+ return;
+ }
+
// `build`/`files` can always be served from the cache
if (ASSETS.includes(url.pathname)) {
const response = await cache.match(url.pathname);