Replace forEach() with for()

This commit is contained in:
redphx
2024-10-22 10:42:09 +07:00
parent 01502363ab
commit 6cfff0274d
7 changed files with 25 additions and 16 deletions

View File

@@ -219,9 +219,10 @@ export class StreamBadges {
];
const $container = CE('div', {class: 'bx-badges'});
BADGES.forEach(item => {
for (const item of BADGES) {
if (!item) {
return;
continue;
}
let $badge: HTMLElement;
@@ -232,7 +233,7 @@ export class StreamBadges {
}
$container.appendChild($badge);
});
};
this.$container = $container;
await this.start();

View File

@@ -221,9 +221,10 @@ export class StreamUiHandler {
}
const observer = new MutationObserver(mutationList => {
mutationList.forEach(item => {
let item: MutationRecord;
for (item of mutationList) {
if (item.type !== 'childList') {
return;
continue;
}
item.addedNodes.forEach(async $node => {
@@ -263,7 +264,7 @@ export class StreamUiHandler {
// Handle System Menu bar
StreamUiHandler.handleSystemMenu($elm);
});
});
};
});
observer.observe($screen, {subtree: true, childList: true});