mirror of
https://github.com/xxnuo/MTranServer.git
synced 2026-09-03 06:35:20 +08:00
fix(desktop): can't exit
This commit is contained in:
@@ -162,8 +162,11 @@ async function restartServer() {
|
||||
async function quitApp() {
|
||||
await logDesktop('quit app');
|
||||
app.isQuitting = true;
|
||||
await stopServerInstance();
|
||||
const stopPromise = stopServerInstance();
|
||||
const timeoutPromise = new Promise((resolve) => setTimeout(resolve, 5000));
|
||||
await Promise.race([stopPromise, timeoutPromise]);
|
||||
app.quit();
|
||||
setTimeout(() => app.exit(0), 2000);
|
||||
}
|
||||
|
||||
function updateLocale(nextLocale) {
|
||||
|
||||
@@ -32,7 +32,7 @@ const messages = {
|
||||
trayOpenDocs: 'API 文档',
|
||||
trayOpenRepo: '仓库地址',
|
||||
trayServiceStatus: '服务状态',
|
||||
trayServiceRunning: '运行中',
|
||||
trayServiceRunning: '启动中',
|
||||
trayServiceStopped: '已停止',
|
||||
trayServiceManagement: '服务管理',
|
||||
trayOpenSettings: '设置',
|
||||
|
||||
Reference in New Issue
Block a user