From 571e204f870716377f4c33125d0e8a9ef144808d Mon Sep 17 00:00:00 2001 From: uwaa Date: Thu, 23 Jan 2025 02:32:51 +0000 Subject: [PATCH] make rot.js check placeholders --- static/js/rot.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/static/js/rot.js b/static/js/rot.js index fe843dfb..6c6e2690 100644 --- a/static/js/rot.js +++ b/static/js/rot.js @@ -148,8 +148,14 @@ setMusic(rand(musicContainer.children).src); return true; } else { - setMusic(null); - return false; + const placeholderContainer = ptp.querySelector(".placeholder-container"); + if (placeholderContainer && placeholderContainer.href.endsWith(".m4a")) { + setMusic(placeholderContainer.href); + return true; + } else { + setMusic(null); + return false; + } } });