bug fix: Tiles werden nach Chat nicht geladen

This commit is contained in:
concierge committed 2026-11-03 17:26:14 +01:00
1 parent 95486c6737
commit 23a9df66f4
2 files changed
+19 -1

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@
* damit er sowohl die mobilen Views als auch die statischen Assets
* kontrolliert. Der Cache-Name wird pro App-Wurzel gebildet.
*/
const VERSION = 'cmbnet-pwa-v12';
const VERSION = 'cmbnet-pwa-v13';
const BASE = new URL('./', self.location).href;
const SHELL_CACHE = `${VERSION}-shell`;
const TILE_CACHE = `${VERSION}-tiles`;
+18
View File
@@ -472,11 +472,29 @@ function bindTabs() {
if (btn.dataset.tab === 'chat') {
const cont = document.getElementById('mobileChatMessages');
if (cont) cont.scrollTop = cont.scrollHeight;
} else if (btn.dataset.tab === 'map') {
refreshMobileMap();
}
});
});
}
function refreshMobileMap() {
if (!map) return;
// Während der Chat-Ansicht ist der Kartencontainer display:none. Beim
// Zurückwechseln muss Leaflet die Größe neu messen. Zusätzlich werden die
// Kacheln neu angefordert, da sie im versteckten Zustand nicht aktualisiert
// wurden.
requestAnimationFrame(() => {
if (!map) return;
map.invalidateSize({pan: false});
if (currentBaseLayer && typeof currentBaseLayer.redraw === 'function') {
currentBaseLayer.redraw();
}
});
}
function bindButtons() {
const logout = document.getElementById('mobileLogout');
if (logout) logout.addEventListener('click', () => {window.location.href = window.CMBNET_LOGOUT_URL || appUrl('');});