fix track right clicks

This commit is contained in:
edidealt 2026-03-20 20:51:05 +00:00
parent 98b65509ea
commit cc2f28a798

View file

@ -1317,10 +1317,12 @@ export async function handleTrackAction(
showNotification('Link copied to clipboard!'); showNotification('Link copied to clipboard!');
}); });
} else if (action === 'open-in-new-tab') { } else if (action === 'open-in-new-tab') {
// Use stored href from card if available, otherwise construct URL // Use stored href from card if available and not a track, otherwise construct URL
const contextMenu = document.getElementById('context-menu'); const contextMenu = document.getElementById('context-menu');
const storedHref = contextMenu?._contextHref; const storedHref = contextMenu?._contextHref;
const url = storedHref const contextType = contextMenu?._contextType;
const url =
storedHref && contextType !== 'track'
? `${window.location.origin}${storedHref}` ? `${window.location.origin}${storedHref}`
: `${window.location.origin}/track/${item.id || item.uuid}`; : `${window.location.origin}/track/${item.id || item.uuid}`;