From 9e6675b8d29098d0fb4c8381cdaabe000523d362 Mon Sep 17 00:00:00 2001 From: Ben Allen <108441023+benalleng@users.noreply.github.com> Date: Thu, 18 Apr 2024 11:49:42 -0400 Subject: [PATCH] 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 --- capture/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/capture/index.js b/capture/index.js index e41aed69..0fd3106f 100644 --- a/capture/index.js +++ b/capture/index.js @@ -94,6 +94,7 @@ app.get('/*', async (req, res) => { if (commentId) { console.timeLog(timeLabel, 'scrolling to comment') await page.waitForSelector('.outline-it') + await new Promise((resolve, _reject) => setTimeout(resolve, 100)) } const file = await page.screenshot({ type: 'png', captureBeyondViewport: false })