Skip to content

Commit 3622299

Browse files
committed
electron reset
1 parent bb3ac94 commit 3622299

4 files changed

Lines changed: 16 additions & 2 deletions

File tree

chat2db-client/src/i18n/zh-cn/setting.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default {
5050
'setting.text.autoUpdate': '新版自动下载并安装更新',
5151
'setting.text.manualUpdate': '仅在新版本发布时提醒我',
5252
'setting.button.iSee': '我知道了',
53-
'setting.text.newEditionIsReady': '新版本以下载完成, 重启软件将会安装新版本',
53+
'setting.text.newEditionIsReady': '新版本已下载完成, 重启软件将会安装新版本',
5454
'setting.button.goToUpdate': '前往更新',
5555
'setting.text.UpdatedLatestVersion': '已更新到最新版本 {1}',
5656

chat2db-client/src/main/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ ipcMain.handle('get-product-name', () => {
9191
return name;
9292
});
9393

94-
// 注册退出应用事件
94+
// 重启app
9595
ipcMain.on('quit-app', () => {
96+
app.relaunch();
9697
app.quit();
9798
});
9899

chat2db-client/src/main/menu.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ const registerAppMenu = (mainWindow, orgs) => {
2020
},
2121
},
2222
{ type: 'separator' },
23+
{
24+
label: '重新启动',
25+
click() {
26+
// 退出程序
27+
app.relaunch();
28+
app.quit();
29+
},
30+
},
2331
{
2432
label: '退出',
2533
accelerator: process.platform === 'darwin' ? 'Cmd+Q' : 'Alt+F4',

chat2db-client/src/utils/sort.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
* @returns
66
*/
77
export function compareStrings(a: string, b: string) {
8+
9+
if (!a || !b ) {
10+
return 0;
11+
}
12+
813
// 比较字符串长度
914
if (a.length !== b.length) {
1015
return a.length - b.length;

0 commit comments

Comments
 (0)