From 9bc27042da4f9356aca428966e22621d853cdfcf Mon Sep 17 00:00:00 2001 From: MarekWo Date: Sun, 18 Jan 2026 16:28:30 +0100 Subject: [PATCH] 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 --- app/static/js/app.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/static/js/app.js b/app/static/js/app.js index 9f7bcff..f239784 100644 --- a/app/static/js/app.js +++ b/app/static/js/app.js @@ -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(); }); });