fix(updater): show header action only when update is available
Hide the header update action until a newer release is confirmed. Register update notifications before renderer initialization so startup cannot miss them. Refresh the public product screenshot and release metadata for v2.0.7.
This commit is contained in:
+3
-4
@@ -369,10 +369,6 @@ async function init() {
|
||||
if (versionLabel) versionLabel.textContent = `v${version}`;
|
||||
} catch {}
|
||||
|
||||
// Update listeners
|
||||
window.api.onUpdateAvailable(showUpdateBanner);
|
||||
window.api.onUpdateProgress(handleUpdateProgress);
|
||||
|
||||
window.api.onUploadProgress((data) => {
|
||||
handleProgress(data);
|
||||
});
|
||||
@@ -660,6 +656,7 @@ function _syncHeaderUpdateState() {
|
||||
? `Update v${version || 'unbekannt'} verfügbar. Klicken zum Installieren.`
|
||||
: 'Nach Aktualisierungen suchen';
|
||||
if (button) {
|
||||
button.hidden = !available;
|
||||
button.classList.toggle('update-available', available);
|
||||
button.classList.toggle('is-checking', _updateCheckBusy);
|
||||
button.disabled = _updateCheckBusy;
|
||||
@@ -6734,6 +6731,8 @@ function updateStatsPanel() {
|
||||
}
|
||||
|
||||
// --- Start ---
|
||||
window.api.onUpdateAvailable(showUpdateBanner);
|
||||
window.api.onUpdateProgress(handleUpdateProgress);
|
||||
window.api.onPrepareClose(prepareForWindowClose);
|
||||
init().then(() => {
|
||||
window.api.signalCloseHandshakeReady();
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@
|
||||
</div>
|
||||
<div class="header-spacer" aria-hidden="true"></div>
|
||||
<div class="header-cluster header-utilities">
|
||||
<button class="header-update-button" id="headerUpdateBtn" title="Nach Aktualisierungen suchen" aria-label="Nach Aktualisierungen suchen" data-tooltip="Nach Aktualisierungen suchen">
|
||||
<button class="header-update-button" id="headerUpdateBtn" title="Nach Aktualisierungen suchen" aria-label="Nach Aktualisierungen suchen" data-tooltip="Nach Aktualisierungen suchen" hidden>
|
||||
<svg class="header-action-icon" aria-hidden="true"><use href="#icon-download"></use></svg>
|
||||
<span class="header-update-label">Update</span>
|
||||
</button>
|
||||
|
||||
@@ -1772,6 +1772,10 @@ select.hs-input { max-width: none; width: auto; min-width: 140px; }
|
||||
transition: background-color .14s, transform .14s;
|
||||
}
|
||||
|
||||
.header-update-button[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.header-update-button::after {
|
||||
content: attr(data-tooltip);
|
||||
position: absolute;
|
||||
|
||||
Reference in New Issue
Block a user