diff --git a/frontend/js/app.js b/frontend/js/app.js index 8036cea..96c106f 100644 --- a/frontend/js/app.js +++ b/frontend/js/app.js @@ -570,10 +570,15 @@ let knownHash = null; export function updateVersionIndicator({ version, latest_version, update_available }) { const label = document.getElementById('versionLabel'); const badge = document.getElementById('versionBadge'); - if (label) label.textContent = version ? 'v' + version : ''; + if (label) label.textContent = version ? 'v' + version : '-'; if (badge) badge.hidden = !update_available; } -setInterval(async () => { + +// Show loading state while first poll resolves +const verLabel = document.getElementById('versionLabel'); +if (verLabel) verLabel.textContent = t('common.checking'); + +async function checkVersion() { try { const res = await fetch('/api/version'); const data = await res.json(); @@ -590,7 +595,9 @@ setInterval(async () => { } updateVersionIndicator(data); } catch {} -}, 15000); +} +checkVersion(); // Fire first poll immediately +setInterval(checkVersion, 15000); // Session timeout warning - check JWT expiry every minute if (isAuthenticated()) { diff --git a/frontend/js/i18n/en.js b/frontend/js/i18n/en.js index 1f5c799..4babdca 100644 --- a/frontend/js/i18n/en.js +++ b/frontend/js/i18n/en.js @@ -35,6 +35,7 @@ export default { 'common.saving': 'Saving...', 'common.deleting': 'Deleting...', 'common.loading': 'Loading...', + 'common.checking': 'Checking...', 'confirm_delete.type_label': 'Type "{name}" to confirm', 'confirm_delete.failed': 'Action failed', 'common.connected': 'Connected', diff --git a/frontend/js/i18n/es.js b/frontend/js/i18n/es.js index 560ac14..fd64d95 100644 --- a/frontend/js/i18n/es.js +++ b/frontend/js/i18n/es.js @@ -31,6 +31,7 @@ export default { 'common.edit': 'Editar', 'common.done': 'Listo', 'common.loading': 'Cargando...', + 'common.checking': 'Verificando...', 'common.connected': 'Conectado', 'common.disconnected': 'Desconectado', 'common.never': 'Nunca',