Skip to content

Commit

Permalink
chore(version): 0.8.22
Browse files Browse the repository at this point in the history
  • Loading branch information
kangfenmao committed Dec 4, 2024
1 parent 100dbc8 commit 2a674c1
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 9 deletions.
5 changes: 1 addition & 4 deletions electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,4 @@ electronDownload:
afterSign: scripts/notarize.js
releaseInfo:
releaseNotes: |
修复快捷翻译部分模型无法正常使用问题
改进智能体页面搜索功能
改进重新回复按钮功能
重新生成的图标修改为@符号
修复删除助手会导致应用崩溃的问题
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "CherryStudio",
"version": "0.8.21",
"version": "0.8.22",
"private": true,
"description": "A powerful AI assistant for producer.",
"main": "./out/main/index.js",
Expand Down
32 changes: 29 additions & 3 deletions src/main/services/AppUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ export default class AppUpdater {
autoUpdater.on('update-available', (releaseInfo: UpdateInfo) => {
autoUpdater.logger?.info('检测到新版本,开始自动下载')
mainWindow.webContents.send('update-available', releaseInfo)

dialog.showMessageBox({
type: 'info',
title: '正在下载新版本',
message: `新版本 ${releaseInfo.version}`,
detail: this.formatReleaseNotes(releaseInfo.releaseNotes)
})
})

// 检测到不需要更新时
Expand All @@ -34,13 +41,15 @@ export default class AppUpdater {
})

// 当需要更新的内容下载完成后
autoUpdater.on('update-downloaded', () => {
logger.info('下载完成,询问用户是否更新')
autoUpdater.on('update-downloaded', (releaseInfo: UpdateInfo) => {
logger.info('下载完成,询问用户是否更新', releaseInfo)

dialog
.showMessageBox({
type: 'info',
title: '安装更新',
message: '更新已下载完成,是否立即安装?',
message: `新版本 ${releaseInfo.version} 已准备就绪`,
detail: this.formatReleaseNotes(releaseInfo.releaseNotes),
buttons: ['稍后安装', '立即安装'],
defaultId: 1,
cancelId: 0
Expand All @@ -55,4 +64,21 @@ export default class AppUpdater {

this.autoUpdater = autoUpdater
}

private formatReleaseNotes(releaseNotes: string | ReleaseNoteInfo[] | null | undefined): string {
if (!releaseNotes) {
return '暂无更新说明'
}

if (typeof releaseNotes === 'string') {
return releaseNotes
}

return releaseNotes.map((note) => note.note).join('\n')
}
}

interface ReleaseNoteInfo {
readonly version: string
readonly note: string | null
}
2 changes: 1 addition & 1 deletion src/renderer/src/pages/home/Messages/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ const MessageItem: FC<Props> = ({
<MessageTokens message={message} isLastMessage={isLastMessage} />
<MessageMenubar
message={message}
assistantModel={assistant.model}
assistantModel={assistant?.model}
model={model}
index={index}
isLastMessage={isLastMessage}
Expand Down

0 comments on commit 2a674c1

Please sign in to comment.