Auto-Updater: Doppelstart verhindern + Download-Status sichtbar
- State-Tracking im Main-Prozess (idle/checking/downloading/ready) - Manueller Check gibt aktuellen Status zurück statt Squirrel-Doppelstart - Auto-Check nur wenn idle (kein Konflikt mit laufendem Download) - Frontend synchronisiert Status beim Mount und Modal-Öffnen - getUpdateStatus IPC für synchrone Status-Abfrage Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
2c6ac0745d
commit
d909909591
3 changed files with 61 additions and 13 deletions
|
|
@ -65,6 +65,11 @@ export default function App() {
|
|||
setUpdateStatus('error');
|
||||
setUpdateError(msg || 'Unbekannter Fehler');
|
||||
});
|
||||
// Sync initial status (Hintergrund-Download könnte bereits laufen)
|
||||
const currentState = api.getUpdateStatus?.();
|
||||
if (currentState === 'downloading') setUpdateStatus('downloading');
|
||||
else if (currentState === 'ready') setUpdateStatus('ready');
|
||||
else if (currentState === 'checking') setUpdateStatus('checking');
|
||||
}, [isElectron]);
|
||||
|
||||
// Fetch plugin list
|
||||
|
|
@ -185,7 +190,17 @@ export default function App() {
|
|||
)}
|
||||
<span
|
||||
className="hub-version hub-version-clickable"
|
||||
onClick={() => setShowVersionModal(true)}
|
||||
onClick={() => {
|
||||
// Status vom Main-Prozess synchronisieren bevor Modal öffnet
|
||||
if (isElectron) {
|
||||
const api = (window as any).electronAPI;
|
||||
const s = api.getUpdateStatus?.();
|
||||
if (s === 'downloading') setUpdateStatus('downloading');
|
||||
else if (s === 'ready') setUpdateStatus('ready');
|
||||
else if (s === 'checking') setUpdateStatus('checking');
|
||||
}
|
||||
setShowVersionModal(true);
|
||||
}}
|
||||
title="Versionsinformationen"
|
||||
>
|
||||
v{version}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue