Fix errors with setTimeout/setInterval

This commit is contained in:
redphx
2024-04-25 17:46:02 +07:00
parent 9b9a7d2bf2
commit 53676ad733
16 changed files with 30 additions and 30 deletions

View File

@@ -67,7 +67,7 @@ export function setupScreenshotButton() {
takeScreenshot(() => {
// Hide button
$btn.setAttribute('data-showing', 'false');
setTimeout(() => {
window.setTimeout(() => {
if (!timeout) {
$btn.setAttribute('data-capturing', 'false');
}
@@ -84,7 +84,7 @@ export function setupScreenshotButton() {
$btn.setAttribute('data-capturing', 'false');
timeout && clearTimeout(timeout);
timeout = setTimeout(() => {
timeout = window.setTimeout(() => {
timeout = null;
$btn.setAttribute('data-showing', 'false');
$btn.setAttribute('data-capturing', 'false');