From 27247aec12ccd790aaa3bdc949d74f92689641f9 Mon Sep 17 00:00:00 2001 From: pompurin404 Date: Tue, 24 Sep 2024 23:59:42 +0800 Subject: [PATCH] fix linux relaunch sandbox --- changelog.md | 16 ++++----------- src/main/index.ts | 20 ++++++++++++++++++- .../connections/connection-item.tsx | 11 +++++++--- 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/changelog.md b/changelog.md index b73cc27..1714be6 100644 --- a/changelog.md +++ b/changelog.md @@ -1,14 +1,6 @@ -### Breaking Changes - -- 为了修复macOS应用内更新问题,此版本需要手动下载dmg进行安装 - -### Features - -- 支持自定义延迟测试并发数量 -- 完善Sub-Store环境变量 -- 支持查看已关闭的连接 - ### Bug Fixes -- 修复macOS应用内更新后权限丢失的问题 -- 修复高版本macOS SSID获取失败的问题 +- 修复便携版无法自动更新的问题 +- gif图标缓存后无法播放的问题 +- 修复Linux重启应用进入沙盒环境的问题 +- 修复已关闭连接信息过时的问题 diff --git a/src/main/index.ts b/src/main/index.ts index a8287c5..3180180 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -10,7 +10,7 @@ import { createTray } from './resolve/tray' import { init } from './utils/init' import { join } from 'path' import { initShortcut } from './resolve/shortcut' -import { execSync } from 'child_process' +import { execSync, spawn } from 'child_process' import { createElevateTask } from './sys/misc' import { initProfileUpdater } from './core/profileUpdater' import { existsSync, writeFileSync } from 'fs' @@ -48,6 +48,24 @@ if (!gotTheLock) { app.quit() } +export function customRelaunch(): void { + const script = `while kill -0 ${process.pid} 2>/dev/null; do + sleep 0.1 +done +${process.argv.join(' ')} & disown +exit +` + spawn('sh', ['-c', `"${script}"`], { + shell: true, + detached: true, + stdio: 'ignore' + }) +} + +if (process.platform === 'linux') { + app.relaunch = customRelaunch +} + if (process.platform === 'win32') { // https://github.com/electron/electron/issues/43278 // https://github.com/electron/electron/issues/36698 diff --git a/src/renderer/src/components/connections/connection-item.tsx b/src/renderer/src/components/connections/connection-item.tsx index d46920b..640dc48 100644 --- a/src/renderer/src/components/connections/connection-item.tsx +++ b/src/renderer/src/components/connections/connection-item.tsx @@ -35,7 +35,12 @@ const ConnectionItem: React.FC = (props) => {
- + {info.metadata.type}({info.metadata.network.toUpperCase()})
@@ -76,7 +81,7 @@ const ConnectionItem: React.FC = (props) => {