mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-23 10:42:00 +00:00
feat(desktop): add Update now button to About panel (#50186)
This commit is contained in:
parent
2f4f23fbfb
commit
65a477f12e
7 changed files with 29 additions and 4 deletions
|
|
@ -13,7 +13,8 @@ import {
|
|||
$updateStatus,
|
||||
checkUpdates,
|
||||
openUpdatesWindow,
|
||||
refreshDesktopVersion
|
||||
refreshDesktopVersion,
|
||||
startActiveUpdate
|
||||
} from '@/store/updates'
|
||||
|
||||
import { ListRow, SectionHeading, SettingsContent } from './primitives'
|
||||
|
|
@ -141,9 +142,14 @@ export function AboutSettings() {
|
|||
</Button>
|
||||
|
||||
{behind > 0 && supported && !applying && (
|
||||
<Button onClick={() => openUpdatesWindow()} size="sm">
|
||||
{a.seeWhatsNew}
|
||||
</Button>
|
||||
<>
|
||||
<Button onClick={() => startActiveUpdate()} size="sm">
|
||||
{a.updateNow}
|
||||
</Button>
|
||||
<Button onClick={() => openUpdatesWindow()} size="sm" variant="textStrong">
|
||||
{a.seeWhatsNew}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
|
||||
<Button asChild className="ml-auto" size="sm" variant="text">
|
||||
|
|
|
|||
|
|
@ -384,6 +384,7 @@ export const en: Translations = {
|
|||
checkNow: 'Check now',
|
||||
checking: 'Checking…',
|
||||
seeWhatsNew: "See what's new",
|
||||
updateNow: 'Update now',
|
||||
releaseNotes: 'Release notes',
|
||||
onLatest: "You're on the latest version.",
|
||||
installing: 'An update is currently installing.',
|
||||
|
|
|
|||
|
|
@ -506,6 +506,7 @@ export const ja = defineLocale({
|
|||
checkNow: '今すぐ確認',
|
||||
checking: '確認中…',
|
||||
seeWhatsNew: '新機能を見る',
|
||||
updateNow: '今すぐ更新',
|
||||
releaseNotes: 'リリースノート',
|
||||
onLatest: '最新バージョンです。',
|
||||
installing: '更新をインストール中です。',
|
||||
|
|
|
|||
|
|
@ -281,6 +281,7 @@ export interface Translations {
|
|||
checkNow: string
|
||||
checking: string
|
||||
seeWhatsNew: string
|
||||
updateNow: string
|
||||
releaseNotes: string
|
||||
onLatest: string
|
||||
installing: string
|
||||
|
|
|
|||
|
|
@ -494,6 +494,7 @@ export const zhHant = defineLocale({
|
|||
checkNow: '立即檢查',
|
||||
checking: '檢查中…',
|
||||
seeWhatsNew: '查看新增內容',
|
||||
updateNow: '立即更新',
|
||||
releaseNotes: '發行說明',
|
||||
onLatest: '你已是最新版本。',
|
||||
installing: '正在安裝更新。',
|
||||
|
|
|
|||
|
|
@ -582,6 +582,7 @@ export const zh: Translations = {
|
|||
checkNow: '立即检查',
|
||||
checking: '检查中…',
|
||||
seeWhatsNew: '查看新增内容',
|
||||
updateNow: '立即更新',
|
||||
releaseNotes: '发行说明',
|
||||
onLatest: '你已是最新版本。',
|
||||
installing: '正在安装更新。',
|
||||
|
|
|
|||
|
|
@ -195,6 +195,20 @@ export function openUpdatesWindow(): void {
|
|||
openUpdateOverlayFor(isRemoteMode() ? 'backend' : 'client')
|
||||
}
|
||||
|
||||
/**
|
||||
* Start applying the available update for the active target right away. Opens
|
||||
* the updates overlay first so the user sees apply progress (the overlay
|
||||
* renders ApplyingView once `applying` flips true), then kicks off the install.
|
||||
* Used by the "Update now" affordance on the About panel, which would otherwise
|
||||
* only be able to open the changelog overlay.
|
||||
*/
|
||||
export function startActiveUpdate(): void {
|
||||
const target: UpdateTarget = isRemoteMode() ? 'backend' : 'client'
|
||||
$updateOverlayTarget.set(target)
|
||||
$updateOverlayOpen.set(true)
|
||||
void (target === 'backend' ? applyBackendUpdate() : applyUpdates())
|
||||
}
|
||||
|
||||
/** Re-read the running app's version from the Electron main process and
|
||||
* publish it on `$desktopVersion`. Called when the About panel mounts, the
|
||||
* update flow finishes, and the window regains focus, so the About text
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue