Offline-Fallbacks für diary, poison, map + SW-Erweiterung

- sw.js: /api/places, /api/breeder/map-markers, /api/gassi-zeiten in _CACHEABLE_GET; /api/lost/report und /api/walks in _QUEUEABLE
- diary.js: localStorage-Cache pro Hund, Fallback bei Offline mit Toast
- poison.js: localStorage-Cache, Fallback bei Offline mit Toast (sicherheitsrelevant)
- map.js: POI-Cache (places/poison/breeders) in localStorage, Offline-Toast + Fallback auf gecachte Daten
This commit is contained in:
rene 2026-05-15 17:02:26 +02:00
parent 0c0daaad6b
commit 53fcb61933
6 changed files with 222 additions and 14 deletions

View file

@ -119,6 +119,8 @@ const _QUEUEABLE = [
{ re: /^\/api\/training\/sessions$/, methods: ['POST'] },
{ re: /^\/api\/training\/progress$/, methods: ['POST'] },
{ re: /^\/api\/poison$/, methods: ['POST'] },
{ re: /^\/api\/lost\/report$/, methods: ['POST'] },
{ re: /^\/api\/walks$/, methods: ['POST'] },
];
function _isQueueable(pathname, method) {
return _QUEUEABLE.some(q => q.methods.includes(method) && q.re.test(pathname));
@ -139,6 +141,9 @@ const _CACHEABLE_GET = [
/^\/api\/wiki\/rassen/,
/^\/api\/dogs\/\d+\/diary\/stats/,
/^\/api\/routes$/,
/^\/api\/places$/,
/^\/api\/breeder\/map-markers$/,
/^\/api\/gassi-zeiten/,
// Drei Welten — offline-fähig
/^\/api\/streak\/\d+/,
/^\/api\/forum\/threads/,