From 6737fff0a7e387f2948fee9ed180e29cd21e8b0d Mon Sep 17 00:00:00 2001 From: geekgeekrun Date: Sun, 17 Mar 2024 17:19:55 +0800 Subject: [PATCH] adjust sequence of hooks.userInfoResponse?.promise(userInfoResponse) - regardless whether it's error or not --- packages/geek-auto-start-chat-with-boss/index.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/geek-auto-start-chat-with-boss/index.mjs b/packages/geek-auto-start-chat-with-boss/index.mjs index 0401f87..92aeca3 100644 --- a/packages/geek-auto-start-chat-with-boss/index.mjs +++ b/packages/geek-auto-start-chat-with-boss/index.mjs @@ -113,6 +113,7 @@ export async function mainLoop (hooks) { hooks.pageLoaded?.call() let userInfoResponse = await userInfoPromise + await hooks.userInfoResponse?.promise(userInfoResponse) if (userInfoResponse.code !== 0) { autoStartChatEventBus.emit('LOGIN_STATUS_INVALID', { userInfoResponse @@ -121,7 +122,6 @@ export async function mainLoop (hooks) { throw new Error("LOGIN_STATUS_INVALID") } else { await storeStorage(page).catch(() => void 0) - await hooks.userInfoResponse?.promise(userInfoResponse) } // check set security question tip modal