Fix static content not switching: hard navigate when no active media

This commit is contained in:
russell@unturf.com 2026-02-08 13:13:44 -05:00
parent 309c291a92
commit 7574318ba8

View file

@ -175,12 +175,20 @@
function transitionTo(data) {
var isPlayable = (data.media_type === 'video' || data.media_type === 'audio');
if (isPlayable && activeMedia && data.media_type === currentMediaType) {
// From a static page, always hard navigate (no media container to swap into)
if (!activeMedia) {
if (data.canonical_url) {
window.location.href = data.canonical_url;
}
return;
}
if (isPlayable && data.media_type === currentMediaType) {
crossfade(data);
} else if (isPlayable) {
hardSwap(data);
} else {
// Static content (PDF, image, etc.) — hard navigate
// Next item is static content — hard navigate
if (data.canonical_url) {
window.location.href = data.canonical_url;
}