🐛修复 hook ipc 时获取不到 eventName 导致其他插件 ipc 通信失败

This commit is contained in:
linyuchen 2024-11-14 14:51:01 +08:00
parent 104839f7ea
commit e1e5c278b9
2 changed files with 5 additions and 1 deletions

View File

@ -46,7 +46,7 @@ export function startHook() {
ipcMain.emit = new Proxy(ipcMain.emit, {
apply(target, thisArg, args: [eventName: string, ...args: any]) {
if (args[2]?.eventName.startsWith('ns-LoggerApi')) {
if (args[2]?.eventName?.startsWith('ns-LoggerApi')) {
return target.apply(thisArg, args)
}
if (logHook) {

View File

@ -11,6 +11,10 @@ function isEmpty(value: unknown) {
}
async function onSettingWindowCreated(view: Element) {
console.log(view)
if (!view){
return
}
const config = await window.llonebot.getConfig()
const ob11Config = { ...config.ob11 }