This commit is contained in:
linyuchen
2024-02-08 11:32:17 +08:00
parent 2c55d84b9f
commit 5e64df0eaa
2 changed files with 13 additions and 5 deletions

View File

@@ -38,11 +38,15 @@ export function hookNTQQApiReceive(window: BrowserWindow) {
if (args?.[1] instanceof Array) {
for (let receiveData of args?.[1]) {
const ntQQApiMethodName = receiveData.cmdName;
log(`received ntqq api message: ${channel} ${ntQQApiMethodName}`, JSON.stringify(receiveData))
// log(`received ntqq api message: ${channel} ${ntQQApiMethodName}`, JSON.stringify(receiveData))
for (let hook of receiveHooks) {
if (hook.method === ntQQApiMethodName) {
new Promise((resolve, reject) => {
hook.hookFunc(receiveData.payload);
try {
hook.hookFunc(receiveData.payload);
}catch (e) {
log("hook error", e, receiveData.payload)
}
}).then()
}
}