add waitForFunction to fix chat list might be undefined

This commit is contained in:
geekgeekrun
2025-04-19 02:51:45 +08:00
parent 7ffe89c41f
commit 1d99cde602

View File

@@ -183,6 +183,9 @@ const mainLoop = async () => {
// eslint-disable-next-line no-constant-condition
while (true) {
await pageMapByName.boss?.waitForFunction(() => {
return Array.isArray(document.querySelector('.main-wrap .chat-user')?.__vue__?.list)
})
// find target boss - with unread icon, or recommend system message
const friendListData = (await pageMapByName.boss!.evaluate(
`