From c1d7eda076b8e576f24c0b57f632b672ee1ba1a4 Mon Sep 17 00:00:00 2001 From: xiang <1984871009@qq.com> Date: Sun, 4 Jun 2023 12:35:06 +0800 Subject: [PATCH] fix: forefront only return first chat --- model/forefront/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/forefront/index.ts b/model/forefront/index.ts index 386b1b0..9468b72 100644 --- a/model/forefront/index.ts +++ b/model/forefront/index.ts @@ -103,9 +103,9 @@ export class Forefrontnew extends Chat { await this.page.focus('.relative > .flex > .w-full > .text-th-primary-dark > div') await this.page.keyboard.type(req.prompt, {delay: 10}); await this.page.keyboard.press('Enter'); - await this.page.waitForSelector('#__next > .flex > .relative > .relative > .w-full:nth-child(1)'); + await this.page.waitForSelector('#__next > .flex > .relative > .relative > .w-full:nth-child(1) > div'); // find markdown list container - const mdList = await this.page.$('#__next > .flex > .relative > .relative > .w-full:nth-child(1)'); + const mdList = await this.page.$('#__next > .flex > .relative > .relative > .w-full:nth-child(1) > div'); const md = mdList; // get latest markdown id let id: number = (await md?.evaluate(el => el.children.length)) || 0