fix: use IMGW Hybrid for current weather

This commit is contained in:
zv
2026-06-02 16:18:10 +02:00
parent 22b8969379
commit fe73bc23ef
13 changed files with 267 additions and 36 deletions

View File

@@ -1,4 +1,4 @@
const CACHE_NAME = "wtr-shell-v1";
const CACHE_NAME = "wtr-shell-v2";
const SHELL = ["/", "/offline", "/manifest.json", "/icons/icon.svg", "/icons/maskable.svg", "/icons/icon-192.png", "/icons/icon-512.png", "/icons/maskable-512.png"];
self.addEventListener("install", (event) => {
@@ -16,7 +16,7 @@ self.addEventListener("activate", (event) => {
self.addEventListener("fetch", (event) => {
if (event.request.method !== "GET") return;
const url = new URL(event.request.url);
if (url.pathname.startsWith("/api/imgw/")) {
if (url.pathname.startsWith("/api/imgw/") || url.pathname === "/api/imgw-current") {
event.respondWith(
fetch(event.request)
.then((response) => {