PWA: absolutte stier så dyplenker virker ved kald førstelast
shelter-repository.ts hentet './data/shelters.json' relativt. Under
/shelter/{romnr} løses det til /shelter/data/shelters.json; SPA-fallback
svarer med index.html (200 text/html), response.json() kaster,
refreshData() returnerer false og loadData() avbryter før
handleDeepLink() — førstegangsbesøkende via delt lenke fikk «Fant ikke
tilfluktsrommet» og tom liste.
Samme rotårsak i index.html (manifest.webmanifest, icons/icon-192.png)
og i manifestet (start_url/scope ".", icons "icons/…"): under en
dyplenke-rute ble manifestet index.html og «legg til på startskjerm»
uteble.
- shelter-repository.ts: `${import.meta.env.BASE_URL}data/shelters.json`
- index.html: /manifest.webmanifest, /icons/icon-192.png
- manifest.webmanifest: start_url "/", scope "/", icons "/icons/…"
Verifisert i ny Playwright-kontekst (tom IndexedDB): /shelter/1681 laster
/data/shelters.json (200 application/json), lista fylles og rommet velges.
Forgejo: #19
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FrDGDmN2WAXvNPS85rWJGK
This commit is contained in:
parent
6a50d86266
commit
2a0c9b49ce
4 changed files with 15 additions and 8 deletions
|
|
@ -2,21 +2,21 @@
|
|||
"name": "Tilfluktsrom",
|
||||
"short_name": "Tilfluktsrom",
|
||||
"description": "Find the nearest public shelter in Norway",
|
||||
"start_url": ".",
|
||||
"scope": ".",
|
||||
"start_url": "/",
|
||||
"scope": "/",
|
||||
"display": "standalone",
|
||||
"orientation": "portrait",
|
||||
"theme_color": "#1A1A2E",
|
||||
"background_color": "#1A1A2E",
|
||||
"icons": [
|
||||
{
|
||||
"src": "icons/icon-192.png",
|
||||
"src": "/icons/icon-192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "any maskable"
|
||||
},
|
||||
{
|
||||
"src": "icons/icon-512.png",
|
||||
"src": "/icons/icon-512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "any maskable"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue