fix: Re-render messages after geo cache loads to show Map buttons

Messages are now displayed immediately, then re-rendered once geo cache
is ready so Map buttons appear for contacts with GPS coordinates.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
MarekWo
2026-01-18 16:28:30 +01:00
parent 7d0fb61533
commit 9bc27042da
+4 -3
View File
@@ -321,10 +321,11 @@ document.addEventListener('DOMContentLoaded', async function() {
// This updates the unread badges without blocking initial load
checkForUpdates(); // No await - runs in background
// Geo cache loads in background - Map buttons will work once it completes
// No need to await - just let it finish whenever
// Geo cache loads in background - once loaded, re-render messages to show Map buttons
geoCachePromise.then(() => {
console.log(`[init] Geo cache loaded in ${(performance.now() - initStart).toFixed(0)}ms`);
console.log(`[init] Geo cache loaded in ${(performance.now() - initStart).toFixed(0)}ms, refreshing messages for Map buttons`);
// Re-render messages now that geo cache is available (Map buttons will appear)
loadMessages();
});
});