add track mix to context
This commit is contained in:
parent
89b8e7e24b
commit
ef86e23109
1 changed files with 10 additions and 4 deletions
14
js/events.js
14
js/events.js
|
|
@ -543,11 +543,17 @@ async function updateContextMenuLikeState(contextMenu, contextTrack) {
|
|||
if (!contextMenu || !contextTrack) return;
|
||||
|
||||
const likeItem = contextMenu.querySelector('li[data-action="toggle-like"]');
|
||||
if (!likeItem) return;
|
||||
if (likeItem) {
|
||||
const { db } = await import('./db.js');
|
||||
const isLiked = await db.isFavorite('track', contextTrack.id);
|
||||
likeItem.textContent = isLiked ? 'Unlike' : 'Like';
|
||||
}
|
||||
|
||||
const { db } = await import('./db.js');
|
||||
const isLiked = await db.isFavorite('track', contextTrack.id);
|
||||
likeItem.textContent = isLiked ? 'Unlike' : 'Like';
|
||||
const trackMixItem = contextMenu.querySelector('li[data-action="track-mix"]');
|
||||
if (trackMixItem) {
|
||||
const hasMix = contextTrack.mixes && contextTrack.mixes.TRACK_MIX;
|
||||
trackMixItem.style.display = hasMix ? 'block' : 'none';
|
||||
}
|
||||
}
|
||||
|
||||
export function initializeTrackInteractions(player, api, mainContent, contextMenu, lyricsManager, ui, scrobbler) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue