mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-26 20:50:30 +08:00
fix: tray icon refresh on shortcut usage
This commit is contained in:
parent
1da82c1b3b
commit
6d21f904b3
@ -10,6 +10,7 @@ import { triggerSysProxy } from '../sys/sysproxy'
|
||||
import { patchMihomoConfig } from '../core/mihomoApi'
|
||||
import { quitWithoutCore, restartCore } from '../core/manager'
|
||||
import { floatingWindow, triggerFloatingWindow } from './floatingWindow'
|
||||
import { updateTrayIcon } from './tray'
|
||||
import i18next from '../../shared/i18n'
|
||||
|
||||
export async function registerShortcut(
|
||||
@ -51,6 +52,7 @@ export async function registerShortcut(
|
||||
// ignore
|
||||
} finally {
|
||||
ipcMain.emit('updateTrayMenu')
|
||||
await updateTrayIcon()
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -74,6 +76,7 @@ export async function registerShortcut(
|
||||
// ignore
|
||||
} finally {
|
||||
ipcMain.emit('updateTrayMenu')
|
||||
await updateTrayIcon()
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -86,6 +89,7 @@ export async function registerShortcut(
|
||||
}).show()
|
||||
mainWindow?.webContents.send('controledMihomoConfigUpdated')
|
||||
ipcMain.emit('updateTrayMenu')
|
||||
await updateTrayIcon()
|
||||
})
|
||||
}
|
||||
case 'globalModeShortcut': {
|
||||
@ -97,6 +101,7 @@ export async function registerShortcut(
|
||||
}).show()
|
||||
mainWindow?.webContents.send('controledMihomoConfigUpdated')
|
||||
ipcMain.emit('updateTrayMenu')
|
||||
await updateTrayIcon()
|
||||
})
|
||||
}
|
||||
case 'directModeShortcut': {
|
||||
@ -108,6 +113,7 @@ export async function registerShortcut(
|
||||
}).show()
|
||||
mainWindow?.webContents.send('controledMihomoConfigUpdated')
|
||||
ipcMain.emit('updateTrayMenu')
|
||||
await updateTrayIcon()
|
||||
})
|
||||
}
|
||||
case 'quitWithoutCoreShortcut': {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user