Skip to content

Commit c81dfe1

Browse files
committed
chore: prepare v1.4.0 release
1 parent 03d2d5a commit c81dfe1

4 files changed

Lines changed: 15 additions & 6 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "chat2api",
3-
"version": "1.3.0",
3+
"version": "1.4.0",
44
"description": "Chat2API 管理器 - 统一管理多个 AI 服务提供商,提供 OpenAI 兼容 API 接口",
55
"main": "./out/main/index.js",
66
"author": {

src/renderer/src/pages/About.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ interface DownloadProgress {
3131

3232
export function About() {
3333
const { t } = useTranslation()
34-
const [appVersion, setAppVersion] = useState<string>('1.3.0')
34+
const [appVersion, setAppVersion] = useState<string>('')
3535

3636
useEffect(() => {
3737
if (window.electronAPI?.app?.getVersion) {
@@ -43,6 +43,7 @@ export function About() {
4343

4444
const [updateInfo, setUpdateInfo] = useState<UpdateInfo>({ phase: 'idle', latestVersion: null, error: null })
4545
const [downloadProgress, setDownloadProgress] = useState<DownloadProgress | null>(null)
46+
const displayAppVersion = appVersion || '...'
4647

4748
useEffect(() => {
4849
if (!window.electronAPI?.app) return
@@ -244,7 +245,7 @@ export function About() {
244245
<div className="inline-flex items-center gap-2 px-3 py-1 mt-3 rounded-full bg-[var(--glass-bg)] border border-[var(--glass-border)]">
245246
<div className="w-1.5 h-1.5 rounded-full bg-[var(--accent-primary)]" />
246247
<span className="text-xs font-mono text-[var(--text-muted)]">
247-
v{appVersion}
248+
v{displayAppVersion}
248249
</span>
249250
</div>
250251
</div>
@@ -295,7 +296,7 @@ export function About() {
295296
<p className="text-xs text-[var(--text-muted)]">
296297
{t('settings.currentVersion')}:{' '}
297298
<span className="text-[var(--text-primary)] font-mono ml-1">
298-
{appVersion}
299+
{displayAppVersion}
299300
</span>
300301
</p>
301302
</div>

tests/updater/in-app-update-flow.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,11 @@ test('about page state is driven by updater events, not manual release URLs', ()
3939
assert.doesNotMatch(about, /releaseUrl/)
4040
assert.doesNotMatch(about, /hasUpdate/)
4141
})
42+
43+
test('about page does not hard-code the app version fallback', () => {
44+
const about = readFileSync('src/renderer/src/pages/About.tsx', 'utf8')
45+
46+
assert.match(about, /getVersion\(\)\.then/)
47+
assert.match(about, /const displayAppVersion = appVersion \|\| '\.\.\.'/)
48+
assert.doesNotMatch(about, /useState<string>\('1\.3\.0'\)/)
49+
})

0 commit comments

Comments
 (0)