mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00:30 +08:00
Compare commits
2 Commits
fb33f37652
...
3670f23a1c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3670f23a1c | ||
|
|
485a936d83 |
@ -68,26 +68,20 @@ async function fixUserDataPermissions(): Promise<void> {
|
|||||||
let quitTimeout: NodeJS.Timeout | null = null
|
let quitTimeout: NodeJS.Timeout | null = null
|
||||||
export let mainWindow: BrowserWindow | null = null
|
export let mainWindow: BrowserWindow | null = null
|
||||||
|
|
||||||
|
const gotTheLock = app.requestSingleInstanceLock()
|
||||||
|
|
||||||
|
if (!gotTheLock) {
|
||||||
|
app.quit()
|
||||||
|
}
|
||||||
|
|
||||||
async function initApp(): Promise<void> {
|
async function initApp(): Promise<void> {
|
||||||
await fixUserDataPermissions()
|
await fixUserDataPermissions()
|
||||||
}
|
}
|
||||||
|
|
||||||
initApp()
|
initApp()
|
||||||
.then(() => {
|
.catch((e) => {
|
||||||
const gotTheLock = app.requestSingleInstanceLock()
|
showSafeErrorBox('common.error.initFailed', `${e}`)
|
||||||
|
app.quit()
|
||||||
if (!gotTheLock) {
|
|
||||||
app.quit()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
// ignore permission fix errors
|
|
||||||
const gotTheLock = app.requestSingleInstanceLock()
|
|
||||||
|
|
||||||
if (!gotTheLock) {
|
|
||||||
app.quit()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
export function customRelaunch(): void {
|
export function customRelaunch(): void {
|
||||||
|
|||||||
@ -695,7 +695,9 @@ const Mihomo: React.FC = () => {
|
|||||||
max={65535}
|
max={65535}
|
||||||
min={0}
|
min={0}
|
||||||
onValueChange={(v) => {
|
onValueChange={(v) => {
|
||||||
patchAppConfig({ showMixedPort: parseInt(v) })
|
const port = parseInt(v)
|
||||||
|
setMixedPortInput(port)
|
||||||
|
patchAppConfig({ showMixedPort: port })
|
||||||
setIsManualPortChange(true)
|
setIsManualPortChange(true)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user