fix(UI): clear stale update banner after successful update

After an update completes, the page reloads but the KV store still has
updateAvailable=true from the pre-update check. This causes the banner
to show "Current 1.30.0-rc.1 → New 1.30.0-rc.1" until the user
manually clicks Check Again.

Now triggers a version re-check before the post-update reload so the
KV store is updated and the banner reflects the correct state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Chris Sherwood 2026-03-20 09:25:52 -07:00 committed by Jake Turner
parent 456a6d33b1
commit ee7e1f2366

View File

@ -258,7 +258,13 @@ export default function SystemUpdatePage(props: { system: Props }) {
// Check if update is complete or errored
if (response.stage === 'complete') {
// Give a moment for the new container to fully start
// Re-check version so the KV store clears the stale "update available" flag
// before we reload, otherwise the banner shows "current → current"
try {
await api.checkLatestVersion(true)
} catch {
// Non-critical - page reload will still work
}
setTimeout(() => {
window.location.reload()
}, 2000)