diff --git a/templates/quiz.html b/templates/quiz.html index 0242b7e..dea5693 100644 --- a/templates/quiz.html +++ b/templates/quiz.html @@ -327,8 +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') { + + // Prüfe, ob MultiplayerPopup existiert und sichtbar ist + const mpPopup = document.getElementById('multiplayerPopup'); + if (!mpPopup || mpPopup.style.display === 'none') { quizifyReady(); } }; @@ -447,6 +449,13 @@ function quizifyReady() { } setCorrectAnswer(); } + +// Entferne Multiplayer-Daten, wenn NICHT im lokalen Multiplayer +if (!window.location.search.includes('local_multiplayer=1')) { + localStorage.removeItem('quizify_multiplayer_names'); + localStorage.removeItem('quizify_multiplayer_scores'); + localStorage.removeItem('quizify_multiplayer_current'); +}