fix: deduplicate NP background crossfade — skip if URL unchanged
_syncNpDirect is called 2-3x per skip from different call sites; the crossfade now no-ops when the cover URL hasn't changed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
97a4cc756d
commit
e0a518fa13
1 file changed
+3
@@ -58,7 +58,10 @@ export function updatePlayerUI(s) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let _npBgCurr = 'a';
|
let _npBgCurr = 'a';
|
||||||
|
let _npBgLastUrl = '';
|
||||||
function _crossfadeNpBg(cv) {
|
function _crossfadeNpBg(cv) {
|
||||||
|
if ((cv || '') === _npBgLastUrl) return;
|
||||||
|
_npBgLastUrl = cv || '';
|
||||||
const currEl = document.getElementById(`np-bg-${_npBgCurr}`);
|
const currEl = document.getElementById(`np-bg-${_npBgCurr}`);
|
||||||
const nextId = _npBgCurr === 'a' ? 'b' : 'a';
|
const nextId = _npBgCurr === 'a' ? 'b' : 'a';
|
||||||
const nextEl = document.getElementById(`np-bg-${nextId}`);
|
const nextEl = document.getElementById(`np-bg-${nextId}`);
|
||||||
|
|||||||
Reference in new issue
Block a user