Add 200ms delay to scroll in capture worker (#1088)

* fix: add 200ms delay to scroll in capture worker

* use: new Promise to wait for timeout
This commit is contained in:
Ben Allen 2024-04-18 11:49:42 -04:00 committed by GitHub
parent a77f778f27
commit 9e6675b8d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -94,6 +94,7 @@ app.get('/*', async (req, res) => {
if (commentId) { if (commentId) {
console.timeLog(timeLabel, 'scrolling to comment') console.timeLog(timeLabel, 'scrolling to comment')
await page.waitForSelector('.outline-it') await page.waitForSelector('.outline-it')
await new Promise((resolve, _reject) => setTimeout(resolve, 100))
} }
const file = await page.screenshot({ type: 'png', captureBeyondViewport: false }) const file = await page.screenshot({ type: 'png', captureBeyondViewport: false })