mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-06 21:28:27 +02:00
Fix errors with setTimeout/setInterval
This commit is contained in:
@@ -76,7 +76,7 @@ export function watchHeader() {
|
||||
let timeout: number | null;
|
||||
const observer = new MutationObserver(mutationList => {
|
||||
timeout && clearTimeout(timeout);
|
||||
timeout = setTimeout(checkHeader, 2000);
|
||||
timeout = window.setTimeout(checkHeader, 2000);
|
||||
});
|
||||
observer.observe($header, {subtree: true, childList: true});
|
||||
|
||||
|
@@ -25,7 +25,7 @@ export function localRedirect(path: string) {
|
||||
}, '');
|
||||
$anchor.addEventListener('click', e => {
|
||||
// Remove element after clicking on it
|
||||
setTimeout(() => {
|
||||
window.setTimeout(() => {
|
||||
$pageContent.removeChild($anchor);
|
||||
}, 1000);
|
||||
});
|
||||
|
Reference in New Issue
Block a user