diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 8a98dd1..d7390b1 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1155,6 +1155,15 @@ export default function App() { }, []); const [showDuplicates, setShowDuplicates] = useState(false); const [updateInfo, setUpdateInfo] = useState<{ latest: string; url: string; downloadUrl: string } | null>(null); + const [checkingUpdate, setCheckingUpdate] = useState(false); + // Fresh update check on demand (opening About), so it never shows a stale + // "you're up to date". Clears updateInfo when the latest check finds nothing. + const checkUpdateNow = useCallback(() => { + setCheckingUpdate(true); + CheckForUpdate().then((u: any) => { + setUpdateInfo(u?.available && u?.latest ? { latest: String(u.latest), url: String(u.url ?? ''), downloadUrl: String(u.download_url ?? '') } : null); + }).catch(() => {}).finally(() => setCheckingUpdate(false)); + }, []); const [updating, setUpdating] = useState(false); const [updateProgress, setUpdateProgress] = useState(0); const [updateError, setUpdateError] = useState(''); @@ -2831,7 +2840,7 @@ export default function App() { case 'tools.duplicates': setShowDuplicates(true); break; case 'tools.refreshCty': refreshCtyDat(); break; case 'tools.downloadRefs': downloadRefs(); break; - case 'help.about': setShowAbout(true); break; + case 'help.about': setShowAbout(true); checkUpdateNow(); break; case 'help.whatsnew': GetChangelog().then((e: any) => { if (Array.isArray(e) && e.length) setWhatsNew(e); else showToast(t('whatsnew.none')); }).catch(() => {}); break; } } @@ -4122,12 +4131,14 @@ export default function App() {

Ham-radio logbook

version {APP_VERSION}

- {updateInfo ? ( + {checkingUpdate ? ( +

{t('upd.checking')}

+ ) : updateInfo ? ( ) : ( -

You're up to date

+

{t('upd.upToDate')}

)}

Developed by {APP_AUTHOR} diff --git a/frontend/src/lib/i18n.tsx b/frontend/src/lib/i18n.tsx index 70af7fd..71a3d42 100644 --- a/frontend/src/lib/i18n.tsx +++ b/frontend/src/lib/i18n.tsx @@ -22,7 +22,7 @@ const en: Dict = { 'upd.install': 'Update now', 'upd.download': 'Download', 'upd.later': 'Later', 'upd.downloading': 'Downloading…', 'upd.installing': 'Installing…', 'upd.restartNote': 'OpsLog will restart on the new version.', - 'upd.retry': 'Retry', 'upd.browser': 'Open page', + 'upd.retry': 'Retry', 'upd.browser': 'Open page', 'upd.checking': 'Checking for updates…', 'upd.upToDate': "You're up to date", 'rate.title': 'QSO rate (QSOs/hour) — projected from the last 10 / 60 minutes', 'lotw.userTip': 'LoTW user — last upload {date} ({days} days ago)', 'menu.file': 'File', 'menu.edit': 'Edit', 'menu.view': 'View', 'menu.tools': 'Tools', @@ -369,6 +369,7 @@ const fr: Dict = { 'btn.logQso': 'Enregistrer', 'btn.clear': 'Effacer', 'btn.spot': 'Spot', 'btn.saving': '…', 'lang.choose': 'Choisissez votre langue', 'lang.chooseHint': 'Modifiable plus tard dans Réglages → Général.', 'lang.english': 'English', 'lang.french': 'Français', 'whatsnew.title': 'Nouveautés', 'whatsnew.close': 'Compris', 'whatsnew.none': 'Aucune nouveauté pour cette version pour le moment.', + 'upd.checking': 'Recherche de mises à jour…', 'upd.upToDate': 'Vous êtes à jour', 'settings.language': 'Langue', 'settings.languageHint': "Langue de l'interface.", 'stats.tab': 'Statistiques', 'stats.title': 'Statistiques du journal', 'stats.loading': 'Analyse du journal…', 'stats.noData': 'Aucune donnée', 'stats.charts': 'Graphiques', 'stats.table': 'Tableau', 'stats.refresh': 'Rafraîchir',