Skip to content

Commit a454f69

Browse files
committed
Add "Restart Now" button when update download completes
Previously the UI only showed "Updating..." and relied on auto-restart. Now shows a visible button so users can manually trigger the restart if auto-install doesn't work (e.g., with GitHub Releases provider).
1 parent 90d47eb commit a454f69

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

src/renderer/components/update-banner.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,8 @@ export function UpdateBanner() {
204204
return null
205205
}
206206

207-
// Updating state (downloading or ready to install, or pending click)
208-
const isUpdating =
209-
state.status === "downloading" || state.status === "ready" || isPending
207+
// Downloading state (downloading or pending click, but not ready)
208+
const isDownloading = state.status === "downloading" || isPending
210209

211210
return (
212211
<div className="fixed bottom-4 left-4 z-50 flex items-center gap-3 rounded-lg border border-border bg-popover p-2.5 text-sm text-popover-foreground shadow-lg animate-in fade-in-0 slide-in-from-bottom-2">
@@ -228,12 +227,12 @@ export function UpdateBanner() {
228227
</>
229228
)}
230229

231-
{/* Updating State (downloading, installing, or pending) */}
232-
{isUpdating && (
230+
{/* Downloading State */}
231+
{(state.status === "downloading" || isPending) && (
233232
<>
234233
<IconSpinner className="h-4 w-4 text-muted-foreground" />
235234
<span className="text-foreground">
236-
{isPending ? "Starting update..." : "Updating..."}
235+
{isPending ? "Starting update..." : "Downloading..."}
237236
</span>
238237
{progress !== undefined && !isPending && (
239238
<span className="text-muted-foreground ml-1">
@@ -242,6 +241,16 @@ export function UpdateBanner() {
242241
)}
243242
</>
244243
)}
244+
245+
{/* Ready to Install State */}
246+
{state.status === "ready" && (
247+
<>
248+
<span className="text-foreground">Update ready</span>
249+
<Button size="sm" onClick={() => installUpdate()}>
250+
Restart Now
251+
</Button>
252+
</>
253+
)}
245254
</div>
246255
)
247256
}

0 commit comments

Comments
 (0)