diff --git a/src/main/resources/public/js/device-select.js b/src/main/resources/public/js/device-select.js index 487fe5d..5b1027a 100644 --- a/src/main/resources/public/js/device-select.js +++ b/src/main/resources/public/js/device-select.js @@ -18,6 +18,13 @@ area.appendChild(select); async function loadDevices() { select.innerHTML = ""; + + // Standardoption "Kein Gerät" + const noneOpt = document.createElement("option"); + noneOpt.value = ""; + noneOpt.textContent = "Kein Gerät"; + select.appendChild(noneOpt); + const devices = await fetchJson(`/api/spotify/devices?username=${encodeURIComponent(username)}`); if (!devices.length) { const opt = document.createElement("option"); @@ -34,6 +41,8 @@ async function loadDevices() { select.appendChild(opt); }); select.disabled = false; + select.value = ""; // "Kein Gerät" als Standard + } loadDevices(); diff --git a/src/main/resources/public/js/game.js b/src/main/resources/public/js/game.js index e8b1964..2f7ef9c 100644 --- a/src/main/resources/public/js/game.js +++ b/src/main/resources/public/js/game.js @@ -316,8 +316,9 @@ function handleGameEnd({ winner }) { // Spotify-Playback Funktion (unverändert) async function playOnSpotify(trackUri, username) { const deviceId = document.getElementById("deviceSelect")?.value; - if (!deviceId) { - alert("Bitte ein Wiedergabegerät auswählen!"); + if (deviceId === "") { + //alert("Bitte ein Wiedergabegerät auswählen!"); + //keine warnung i guess return; } try {