feat: KoePi oeffentlicher Link bekommt eigenes PWA-Manifest (Dickens Prospekte, eigener Startpunkt)

This commit is contained in:
2026-07-18 21:14:22 +02:00
parent 8ff1fd630b
commit e172cbe085
2 changed files with 38 additions and 0 deletions

View File

@@ -4093,6 +4093,18 @@ function PublicKoepi({ token }) {
const [invalid, setInvalid] = useState(false);
const BASE = '/api/tools/koepi/public/' + token;
// Eigenes PWA-Manifest (eigener Name "Dickens Prospekte", eigener
// start_url) statt des normalen App-Manifests — damit eine über diesen
// Link installierte App direkt wieder hier landet, nicht beim Login
useEffect(() => {
document.title = 'Dickens Prospekte';
let link = document.querySelector('link[rel="manifest"]');
const original = link?.getAttribute('href');
if (!link) { link = document.createElement('link'); link.rel = 'manifest'; document.head.appendChild(link); }
link.setAttribute('href', `${BASE}/manifest.json`);
return () => { if (link && original) link.setAttribute('href', original); };
}, [token]);
useEffect(() => {
fetch(BASE + '/prospekte')
.then(async r => { if (!r.ok) throw new Error(); return r.json(); })