style: auto-fix linting issues

This commit is contained in:
binimum 2026-04-05 17:22:39 +00:00 committed by github-actions[bot]
parent 10b7afc36e
commit f3b9cfd2f0
2 changed files with 19 additions and 9 deletions

View file

@ -12,13 +12,18 @@ import {
import { sidePanelManager } from './side-panel.js';
const loadAmLyrics = () => {
const images = Array.from(document.images).filter(img => !img.complete);
const images = Array.from(document.images).filter((img) => !img.complete);
if (images.length === 0) {
import('@uimaxbai/am-lyrics/am-lyrics.js').catch(console.error);
} else {
Promise.all(images.map(img => new Promise(res => {
img.onload = img.onerror = res;
}))).then(() => import('@uimaxbai/am-lyrics/am-lyrics.js').catch(console.error));
Promise.all(
images.map(
(img) =>
new Promise((res) => {
img.onload = img.onerror = res;
})
)
).then(() => import('@uimaxbai/am-lyrics/am-lyrics.js').catch(console.error));
}
};

View file

@ -99,15 +99,20 @@ export class Player {
}
const waitForImagesLoading = () => {
const images = Array.from(document.images).filter(img => !img.complete);
const images = Array.from(document.images).filter((img) => !img.complete);
if (images.length === 0) return Promise.resolve();
return Promise.all(images.map(img => new Promise(res => {
img.onload = img.onerror = res;
})));
return Promise.all(
images.map(
(img) =>
new Promise((res) => {
img.onload = img.onerror = res;
})
)
);
};
if (document.readyState !== 'complete') {
await new Promise(resolve => window.addEventListener('load', resolve));
await new Promise((resolve) => window.addEventListener('load', resolve));
}
await waitForImagesLoading();