diff --git a/js/lyrics.js b/js/lyrics.js index d1a4b64..8ee4dcf 100644 --- a/js/lyrics.js +++ b/js/lyrics.js @@ -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)); } }; diff --git a/js/player.js b/js/player.js index 16967c3..81f57fe 100644 --- a/js/player.js +++ b/js/player.js @@ -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();