Compare commits

...

2 Commits

Author SHA1 Message Date
Memory
3670f23a1c
fix: Improve app instance lock handling 2025-11-18 23:55:07 +08:00
Memory
485a936d83
fix: correct mixed-port configuration issues 2025-11-18 22:10:47 +08:00
2 changed files with 11 additions and 15 deletions

View File

@ -68,26 +68,20 @@ async function fixUserDataPermissions(): Promise<void> {
let quitTimeout: NodeJS.Timeout | null = null
export let mainWindow: BrowserWindow | null = null
const gotTheLock = app.requestSingleInstanceLock()
if (!gotTheLock) {
app.quit()
}
async function initApp(): Promise<void> {
await fixUserDataPermissions()
}
initApp()
.then(() => {
const gotTheLock = app.requestSingleInstanceLock()
if (!gotTheLock) {
app.quit()
}
})
.catch(() => {
// ignore permission fix errors
const gotTheLock = app.requestSingleInstanceLock()
if (!gotTheLock) {
app.quit()
}
.catch((e) => {
showSafeErrorBox('common.error.initFailed', `${e}`)
app.quit()
})
export function customRelaunch(): void {

View File

@ -695,7 +695,9 @@ const Mihomo: React.FC = () => {
max={65535}
min={0}
onValueChange={(v) => {
patchAppConfig({ showMixedPort: parseInt(v) })
const port = parseInt(v)
setMixedPortInput(port)
patchAppConfig({ showMixedPort: port })
setIsManualPortChange(true)
}}
/>