mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00: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 { patchMihomoConfig } from '../core/mihomoApi'
|
||||||
import { quitWithoutCore, restartCore } from '../core/manager'
|
import { quitWithoutCore, restartCore } from '../core/manager'
|
||||||
import { floatingWindow, triggerFloatingWindow } from './floatingWindow'
|
import { floatingWindow, triggerFloatingWindow } from './floatingWindow'
|
||||||
|
import { updateTrayIcon } from './tray'
|
||||||
import i18next from '../../shared/i18n'
|
import i18next from '../../shared/i18n'
|
||||||
|
|
||||||
export async function registerShortcut(
|
export async function registerShortcut(
|
||||||
@ -51,6 +52,7 @@ export async function registerShortcut(
|
|||||||
// ignore
|
// ignore
|
||||||
} finally {
|
} finally {
|
||||||
ipcMain.emit('updateTrayMenu')
|
ipcMain.emit('updateTrayMenu')
|
||||||
|
await updateTrayIcon()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -74,6 +76,7 @@ export async function registerShortcut(
|
|||||||
// ignore
|
// ignore
|
||||||
} finally {
|
} finally {
|
||||||
ipcMain.emit('updateTrayMenu')
|
ipcMain.emit('updateTrayMenu')
|
||||||
|
await updateTrayIcon()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -86,6 +89,7 @@ export async function registerShortcut(
|
|||||||
}).show()
|
}).show()
|
||||||
mainWindow?.webContents.send('controledMihomoConfigUpdated')
|
mainWindow?.webContents.send('controledMihomoConfigUpdated')
|
||||||
ipcMain.emit('updateTrayMenu')
|
ipcMain.emit('updateTrayMenu')
|
||||||
|
await updateTrayIcon()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
case 'globalModeShortcut': {
|
case 'globalModeShortcut': {
|
||||||
@ -97,6 +101,7 @@ export async function registerShortcut(
|
|||||||
}).show()
|
}).show()
|
||||||
mainWindow?.webContents.send('controledMihomoConfigUpdated')
|
mainWindow?.webContents.send('controledMihomoConfigUpdated')
|
||||||
ipcMain.emit('updateTrayMenu')
|
ipcMain.emit('updateTrayMenu')
|
||||||
|
await updateTrayIcon()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
case 'directModeShortcut': {
|
case 'directModeShortcut': {
|
||||||
@ -108,6 +113,7 @@ export async function registerShortcut(
|
|||||||
}).show()
|
}).show()
|
||||||
mainWindow?.webContents.send('controledMihomoConfigUpdated')
|
mainWindow?.webContents.send('controledMihomoConfigUpdated')
|
||||||
ipcMain.emit('updateTrayMenu')
|
ipcMain.emit('updateTrayMenu')
|
||||||
|
await updateTrayIcon()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
case 'quitWithoutCoreShortcut': {
|
case 'quitWithoutCoreShortcut': {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user