mirror of
https://github.com/pompurin404/mihomo-party.git
synced 2024-11-15 19:22:31 +08:00
fix linux relaunch sandbox
This commit is contained in:
parent
ddcf370ffa
commit
27247aec12
16
changelog.md
16
changelog.md
|
@ -1,14 +1,6 @@
|
|||
### Breaking Changes
|
||||
|
||||
- 为了修复macOS应用内更新问题,此版本需要手动下载dmg进行安装
|
||||
|
||||
### Features
|
||||
|
||||
- 支持自定义延迟测试并发数量
|
||||
- 完善Sub-Store环境变量
|
||||
- 支持查看已关闭的连接
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- 修复macOS应用内更新后权限丢失的问题
|
||||
- 修复高版本macOS SSID获取失败的问题
|
||||
- 修复便携版无法自动更新的问题
|
||||
- gif图标缓存后无法播放的问题
|
||||
- 修复Linux重启应用进入沙盒环境的问题
|
||||
- 修复已关闭连接信息过时的问题
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue
Block a user