Fix visibility

This commit is contained in:
2025-12-29 13:32:24 +01:00
parent 0817ff74a7
commit af3484d00a
2 changed files with 61 additions and 4 deletions

View File

@@ -1955,15 +1955,20 @@ function updateVisibility(asset, hidden) {
return r.json();
}).then((updated) => {
storeAsset(updated);
let visibilityMessage = null;
if (updated.hidden) {
loopPlaybackState.set(updated.id, false);
stopAudio(updated.id);
showToast('Asset hidden from broadcast.', 'info');
} else if (isAudioAsset(updated)) {
playAudioFromCanvas(updated, true);
showToast('Asset is now visible and active.', 'success');
visibilityMessage = 'Asset is now visible and active.';
} else {
visibilityMessage = 'Asset is now visible.';
}
if (visibilityMessage) {
showToast(visibilityMessage, 'success');
}
showToast('Asset is now visible.', 'success');
updateRenderState(updated);
drawAndList();
}).catch(() => showToast('Unable to change visibility right now.', 'error'));