diff --git a/src/main/index.ts b/src/main/index.ts index e2ffd3c..7632cfd 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -426,9 +426,13 @@ app.whenReady().then(() => { version: info.version }) }) - autoUpdater.on('update-not-available', (info) => + autoUpdater.on('update-not-available', (info) => { log.info('updater', `Up to date (${info.version})`) - ) + mainWindow?.webContents.send('update-status', { + status: 'up-to-date', + version: info.version + }) + }) autoUpdater.on('download-progress', (p) => log.info('updater', `Downloading: ${Math.round(p.percent)}%`) ) diff --git a/src/preload/index.ts b/src/preload/index.ts index f15f432..891cba7 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -7,7 +7,7 @@ import type { WorktreeInfo, BranchDetail, BranchFile, PrInfo } from '../shared/t import type { GitHubRepo, GitHubPR, GitHubIssue } from '../shared/types' export type UpdateStatus = - | { status: 'available' | 'ready'; version: string } + | { status: 'available' | 'ready' | 'up-to-date'; version: string } | { status: 'error'; message: string } export interface LogEntry { diff --git a/src/renderer/src/components/SettingsView.tsx b/src/renderer/src/components/SettingsView.tsx index 03b811b..4978eec 100644 --- a/src/renderer/src/components/SettingsView.tsx +++ b/src/renderer/src/components/SettingsView.tsx @@ -115,6 +115,9 @@ export default function SettingsView({ onBack }: SettingsViewProps): React.JSX.E {updateStatus?.status === 'ready' && ( v{updateStatus.version} ready to install )} + {updateStatus?.status === 'up-to-date' && ( + Up to date (v{updateStatus.version}) + )} {updateStatus?.status === 'error' && ( {updateStatus.message} )} diff --git a/src/renderer/src/components/Sidebar.tsx b/src/renderer/src/components/Sidebar.tsx index b772672..0fe6b14 100644 --- a/src/renderer/src/components/Sidebar.tsx +++ b/src/renderer/src/components/Sidebar.tsx @@ -1,4 +1,5 @@ import { useState, useEffect, useRef } from 'react' +import type { UpdateStatus } from '../../../preload/index' import type { Project, Session, ViewMode } from '../types' import logoSvg from '../assets/logo.svg' @@ -442,9 +443,7 @@ function EnvScriptSection({ } function VersionIndicator(): React.JSX.Element { - const [update, setUpdate] = useState< - { status: 'available' | 'ready'; version: string } | { status: 'error'; message: string } | null - >(null) + const [update, setUpdate] = useState(null) useEffect(() => { return window.konductorAPI.onUpdateStatus((info) => setUpdate(info))