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,12 +1317,14 @@ export async function handleTrackAction(
showNotification('Link copied to clipboard!');
});
} 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 storedHref = contextMenu?._contextHref;
const url = storedHref
? `${window.location.origin}${storedHref}`
: `${window.location.origin}/track/${item.id || item.uuid}`;
const contextType = contextMenu?._contextType;
const url =
storedHref && contextType !== 'track'
? `${window.location.origin}${storedHref}`
: `${window.location.origin}/track/${item.id || item.uuid}`;
trackOpenInNewTab(type, item.id || item.uuid);
window.open(url, '_blank');