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:
		
							parent
							
								
									a77f778f27
								
							
						
					
					
						commit
						9e6675b8d2
					
				@ -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 })
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user