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

@@ -23,7 +23,7 @@ export function onHistoryChanged(e: PopStateEvent) {
return;
}
setTimeout(RemotePlay.detect, 10);
window.setTimeout(RemotePlay.detect, 10);
const $settings = document.querySelector('.bx-settings-container');
if ($settings) {
@@ -34,7 +34,7 @@ export function onHistoryChanged(e: PopStateEvent) {
RemotePlay.detachPopup();
LoadingScreen.reset();
setTimeout(checkHeader, 2000);
window.setTimeout(checkHeader, 2000);
BxEvent.dispatch(window, BxEvent.STREAM_STOPPED);
}

View File

@@ -543,7 +543,7 @@ export function interceptHttpRequests() {
for (const blocked of BLOCKED_URLS) {
if ((this as any)._url.startsWith(blocked)) {
if (blocked === 'https://dc.services.visualstudio.com') {
setTimeout(clearAllLogs, 1000);
window.setTimeout(clearAllLogs, 1000);
}
return false;
}

View File

@@ -37,7 +37,7 @@ export class Toast {
Toast.#isShowing = true;
Toast.#timeout && clearTimeout(Toast.#timeout);
Toast.#timeout = setTimeout(Toast.#hide, Toast.#DURATION);
Toast.#timeout = window.setTimeout(Toast.#hide, Toast.#DURATION);
// Get values from item
const [msg, status, _] = Toast.#stack.shift()!;