Skip to content

Commit

Permalink
fix(forefront): done text
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangsx committed Jun 9, 2023
1 parent 0649f3b commit 126c81d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions model/forefront/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class AccountPool {

public get(): Account {
const now = moment();
const minInterval = 3 * 60 * 60 + 10 * 60;// 3hour + 10min
const minInterval = 3000 * 60 * 60 + 10 * 60;// 3hour + 10min
for (const item of this.pool) {
if (now.unix() - moment(item.last_use_time).unix() > minInterval) {
console.log(`find old login account:`, item);
Expand Down Expand Up @@ -138,7 +138,7 @@ export class Forefrontnew extends Chat {
}
}

private static async closeVIPPop(page:Page){
private static async closeVIPPop(page: Page) {
await page.waitForSelector('.flex > .w-full:nth-child(1) > .grid:nth-child(2) > .flex > .text-sm')
await page.click('.flex > .w-full:nth-child(1) > .grid:nth-child(2) > .flex > .text-sm')
}
Expand Down Expand Up @@ -327,7 +327,9 @@ export class Forefrontnew extends Chat {
//@ts-ignore
const text: any = await page.evaluate(() => navigator.clipboard.text);
console.log('chat end: ', text);
pt.write("done", text);
pt.write("done", text || await result?.evaluate(el => {
return el.textContent;
}));
} catch (e) {
console.error(e);
} finally {
Expand Down

0 comments on commit 126c81d

Please sign in to comment.