From 2e50aa34a93861539297bb64da693e643912571a Mon Sep 17 00:00:00 2001 From: SimolZimol <70102430+SimolZimol@users.noreply.github.com> Date: Fri, 6 Jun 2025 00:24:53 +0200 Subject: [PATCH] modified: templates/quiz.html --- templates/quiz.html | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/templates/quiz.html b/templates/quiz.html index b97cc1c..0242b7e 100644 --- a/templates/quiz.html +++ b/templates/quiz.html @@ -297,6 +297,10 @@ } function switchGameMode(mode) { + // Beim Moduswechsel Multiplayer-Daten löschen + localStorage.removeItem('quizify_multiplayer_names'); + localStorage.removeItem('quizify_multiplayer_scores'); + localStorage.removeItem('quizify_multiplayer_current'); window.location.href = `/reset_quiz/{{ playlist_id }}?next_mode=${mode}`; } @@ -323,6 +327,10 @@ window.onload = function() { } document.getElementById('startPosition').value = getOption('startPosition', 'start'); updateMultiplayerUI(); + // Starte Quiz nur, wenn KEIN Multiplayer-Popup offen ist + if (!document.getElementById('multiplayerPopup') || document.getElementById('multiplayerPopup').style.display === 'none') { + quizifyReady(); + } }; function onPlayDurationChange() { @@ -426,6 +434,18 @@ checkAnswer = function() { window.onload = function() { // ...dein bisheriger onload code... updateMultiplayerUI(); + // Starte Quiz nur, wenn KEIN Multiplayer-Popup offen ist + if (!document.getElementById('multiplayerPopup') || document.getElementById('multiplayerPopup').style.display === 'none') { + quizifyReady(); + } +} + +function quizifyReady() { + // Hier alles, was nach dem Schließen des Popups passieren soll + if (window.onSpotifyWebPlaybackSDKReady) { + window.onSpotifyWebPlaybackSDKReady(); + } + setCorrectAnswer(); } @@ -533,6 +553,7 @@ function startMultiplayer(e) { localStorage.setItem('quizify_multiplayer_current', 0); document.getElementById('multiplayerPopup').style.display = 'none'; updateMultiplayerUI(); + quizifyReady(); // <-- Musik und Quiz jetzt starten! } {% endif %}