Skip to content

Commit d54cc64

Browse files
jorbenclaude
andauthored
fix(updater): 🐛 fix update checker UI stuck state and layout issues (#37)
Send NOT_AVAILABLE status to renderer in dev mode so the UI doesn't stay stuck on "checking". Also stabilize the UpdateChecker layout with fixed progress bar width and centered container. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7ae4de8 commit d54cc64

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

src/main/ipc/handlers/updater.handler.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import { ipcMain, app } from 'electron';
22
import { IPC_CHANNELS } from '../../../shared/ipc/channels.js';
3+
import { UpdateStatus } from '../../../shared/types/UpdateStatus.js';
34
import { updateService } from '../../services/UpdateService.js';
5+
import { windowManager } from '../../WindowManager.js';
46

57
export function registerUpdaterHandlers() {
68
ipcMain.handle(IPC_CHANNELS.UPDATER.CHECK_FOR_UPDATES, async () => {
79
if (!app.isPackaged) {
810
console.log('[Updater] Skipping update check in development mode');
11+
windowManager.sendToRenderer(IPC_CHANNELS.EVENTS.UPDATER_STATUS, {
12+
status: UpdateStatus.NOT_AVAILABLE,
13+
});
914
return;
1015
}
1116
await updateService.checkForUpdates();

src/renderer/components/UpdateChecker.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const UpdateChecker: React.FC = () => {
7373

7474
case "downloading":
7575
return (
76-
<Space direction="vertical" style={{ width: "100%" }}>
76+
<Space direction="vertical" style={{ width: 300 }}>
7777
<Text>
7878
{t("update.downloading")}{" "}
7979
{statusData.progress !== undefined &&
@@ -127,7 +127,11 @@ const UpdateChecker: React.FC = () => {
127127
}
128128
};
129129

130-
return <div style={{ marginTop: 16 }}>{renderStatus()}</div>;
130+
return (
131+
<div style={{ marginTop: 16, minHeight: 70, display: "flex", alignItems: "center", justifyContent: "center" }}>
132+
{renderStatus()}
133+
</div>
134+
);
131135
};
132136

133137
export default UpdateChecker;

0 commit comments

Comments
 (0)