From 0641e3da33b7c43cfab1f99a6a47b88cbae76e90 Mon Sep 17 00:00:00 2001 From: SamidyFR <168582143+SamidyFR@users.noreply.github.com> Date: Wed, 11 Mar 2026 04:03:24 +0000 Subject: [PATCH] style: auto-fix linting issues --- js/ui-interactions.js | 48 ++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/js/ui-interactions.js b/js/ui-interactions.js index 6ae0213..59f2e06 100644 --- a/js/ui-interactions.js +++ b/js/ui-interactions.js @@ -253,9 +253,7 @@ export function initializeUIInteractions(player, api, ui) { const isVideo = track.type === 'video'; const coverUrl = - isVideo && track.imageId - ? api.getVideoCoverUrl(track.imageId) - : api.getCoverUrl(track.album?.cover); + isVideo && track.imageId ? api.getVideoCoverUrl(track.imageId) : api.getCoverUrl(track.album?.cover); return `
@@ -313,9 +311,7 @@ export function initializeUIInteractions(player, api, ui) { ? SVG_HEART.replace('class="heart-icon"', 'class="heart-icon filled"') : SVG_HEART; - showNotification( - added ? `Added to Liked: ${track.title}` : `Removed from Liked: ${track.title}` - ); + showNotification(added ? `Added to Liked: ${track.title}` : `Removed from Liked: ${track.title}`); } return; } @@ -425,25 +421,31 @@ export function initializeUIInteractions(player, api, ui) { if (topObserver) topObserver.disconnect(); if (bottomObserver) bottomObserver.disconnect(); - bottomObserver = new IntersectionObserver((entries) => { - if (entries[0].isIntersecting && !isQueueRendering && queueEndIndex < currentQueue.length) { - queueEndIndex = Math.min(currentQueue.length, queueEndIndex + QUEUE_CHUNK_SIZE); - if (queueEndIndex - queueStartIndex > QUEUE_MAX_RENDERED) { - queueStartIndex += QUEUE_CHUNK_SIZE; + bottomObserver = new IntersectionObserver( + (entries) => { + if (entries[0].isIntersecting && !isQueueRendering && queueEndIndex < currentQueue.length) { + queueEndIndex = Math.min(currentQueue.length, queueEndIndex + QUEUE_CHUNK_SIZE); + if (queueEndIndex - queueStartIndex > QUEUE_MAX_RENDERED) { + queueStartIndex += QUEUE_CHUNK_SIZE; + } + renderQueueContent(container, true); } - renderQueueContent(container, true); - } - }, { root: container, rootMargin: '200px' }); + }, + { root: container, rootMargin: '200px' } + ); - topObserver = new IntersectionObserver((entries) => { - if (entries[0].isIntersecting && !isQueueRendering && queueStartIndex > 0) { - queueStartIndex = Math.max(0, queueStartIndex - QUEUE_CHUNK_SIZE); - if (queueEndIndex - queueStartIndex > QUEUE_MAX_RENDERED) { - queueEndIndex -= QUEUE_CHUNK_SIZE; + topObserver = new IntersectionObserver( + (entries) => { + if (entries[0].isIntersecting && !isQueueRendering && queueStartIndex > 0) { + queueStartIndex = Math.max(0, queueStartIndex - QUEUE_CHUNK_SIZE); + if (queueEndIndex - queueStartIndex > QUEUE_MAX_RENDERED) { + queueEndIndex -= QUEUE_CHUNK_SIZE; + } + renderQueueContent(container, true); } - renderQueueContent(container, true); - } - }, { root: container, rootMargin: '200px' }); + }, + { root: container, rootMargin: '200px' } + ); topObserver.observe(container.querySelector('#queue-top-sentinel')); bottomObserver.observe(container.querySelector('#queue-bottom-sentinel')); @@ -465,7 +467,7 @@ export function initializeUIInteractions(player, api, ui) { : SVG_HEART; } }); - + isQueueRendering = false; };