fix linux relaunch sandbox
Some checks are pending
Build / windows (arm64) (push) Waiting to run
Build / windows (ia32) (push) Waiting to run
Build / windows (x64) (push) Waiting to run
Build / windows7 (ia32) (push) Waiting to run
Build / windows7 (x64) (push) Waiting to run
Build / linux (arm64) (push) Waiting to run
Build / linux (x64) (push) Waiting to run
Build / macos (arm64) (push) Waiting to run
Build / macos (x64) (push) Waiting to run
Build / updater (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party) (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party-bin) (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party-electron) (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party-electron-bin) (push) Blocked by required conditions
Build / aur-git-updater (push) Waiting to run
Build / Update WinGet Package (push) Blocked by required conditions
Build / Update Homebrew cask (push) Blocked by required conditions

This commit is contained in:
pompurin404 2024-09-24 23:59:42 +08:00
parent b026c5ef56
commit 0b66995b51
No known key found for this signature in database
3 changed files with 31 additions and 16 deletions

View File

@ -1,14 +1,6 @@
### Breaking Changes
- 为了修复macOS应用内更新问题此版本需要手动下载dmg进行安装
### Features
- 支持自定义延迟测试并发数量
- 完善Sub-Store环境变量
- 支持查看已关闭的连接
### Bug Fixes
- 修复macOS应用内更新后权限丢失的问题
- 修复高版本macOS SSID获取失败的问题
- 修复便携版无法自动更新的问题
- gif图标缓存后无法播放的问题
- 修复Linux重启应用进入沙盒环境的问题
- 修复已关闭连接信息过时的问题

View File

@ -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

View File

@ -35,7 +35,12 @@ const ConnectionItem: React.FC<Props> = (props) => {
<div className="w-full flex justify-between">
<div className="w-[calc(100%-48px)]">
<CardHeader className="pb-0 gap-1">
<Chip color={`${info.isActive ? "primary": "danger"}`} size="sm" radius="sm" variant="dot">
<Chip
color={`${info.isActive ? 'primary' : 'danger'}`}
size="sm"
radius="sm"
variant="dot"
>
{info.metadata.type}({info.metadata.network.toUpperCase()})
</Chip>
<div className="text-ellipsis whitespace-nowrap overflow-hidden">
@ -76,7 +81,7 @@ const ConnectionItem: React.FC<Props> = (props) => {
</CardFooter>
</div>
<Button
color={`${info.isActive ? "warning" : "danger"}`}
color={`${info.isActive ? 'warning' : 'danger'}`}
variant="light"
isIconOnly
className="mr-2 my-auto"
@ -84,7 +89,7 @@ const ConnectionItem: React.FC<Props> = (props) => {
close(info.id)
}}
>
{info.isActive ? (<CgClose className="text-lg"/>) : (<CgTrash className="text-lg"/>)}
{info.isActive ? <CgClose className="text-lg" /> : <CgTrash className="text-lg" />}
</Button>
</div>
</Card>