diff --git a/app/modules/telefoni/templates/log.html b/app/modules/telefoni/templates/log.html index 1560638..e62c4c1 100644 --- a/app/modules/telefoni/templates/log.html +++ b/app/modules/telefoni/templates/log.html @@ -1064,7 +1064,8 @@ async function unlinkCase(callId) { } document.addEventListener('DOMContentLoaded', async () => { - cacheInitialSsrRows(document.getElementById('telefoniRows')); + const telefoniRows = document.getElementById('telefoniRows'); + cacheInitialSsrRows(telefoniRows); initLinkContactModalEvents(); initLinkSagModalEvents(); const userFilter = document.getElementById('filterUser'); @@ -1083,6 +1084,14 @@ document.addEventListener('DOMContentLoaded', async () => { document.getElementById('filterFrom').addEventListener('change', loadCalls); document.getElementById('filterTo').addEventListener('change', loadCalls); document.getElementById('filterWithoutCase').addEventListener('change', loadCalls); + + // Keep SSR rows on first paint when they exist; avoid replacing visible data + // with an empty state due to transient API/auth/cache issues in production. + if (hasExistingCallRows(telefoniRows)) { + console.warn('Telefoni: springer initial auto-refresh over, SSR-rækker vises'); + return; + } + await loadCalls({ preserveOnEmpty: true, skipLoadingState: true }); });