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'; import { sidePanelManager } from './side-panel.js';
const loadAmLyrics = () => { 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) { if (images.length === 0) {
import('@uimaxbai/am-lyrics/am-lyrics.js').catch(console.error); import('@uimaxbai/am-lyrics/am-lyrics.js').catch(console.error);
} else { } else {
Promise.all(images.map(img => new Promise(res => { Promise.all(
images.map(
(img) =>
new Promise((res) => {
img.onload = img.onerror = res; img.onload = img.onerror = res;
}))).then(() => import('@uimaxbai/am-lyrics/am-lyrics.js').catch(console.error)); })
)
).then(() => import('@uimaxbai/am-lyrics/am-lyrics.js').catch(console.error));
} }
}; };

View file

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