Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)}%`)
)
Expand Down
2 changes: 1 addition & 1 deletion src/preload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions src/renderer/src/components/SettingsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ export default function SettingsView({ onBack }: SettingsViewProps): React.JSX.E
{updateStatus?.status === 'ready' && (
<span className="text-accent">v{updateStatus.version} ready to install</span>
)}
{updateStatus?.status === 'up-to-date' && (
<span className="text-green-400">Up to date (v{updateStatus.version})</span>
)}
{updateStatus?.status === 'error' && (
<span className="text-red-400">{updateStatus.message}</span>
)}
Expand Down
5 changes: 2 additions & 3 deletions src/renderer/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -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'

Expand Down Expand Up @@ -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<UpdateStatus | null>(null)

useEffect(() => {
return window.konductorAPI.onUpdateStatus((info) => setUpdate(info))
Expand Down
Loading