diff --git a/cmd/soundtouch-web/static/js/app.js b/cmd/soundtouch-web/static/js/app.js index 48895ec..5276126 100644 --- a/cmd/soundtouch-web/static/js/app.js +++ b/cmd/soundtouch-web/static/js/app.js @@ -284,7 +284,7 @@ function handleWebSocketMessage(data) { renderDeviceList(); break; case "status_update": - if (devices[data.deviceId]) { + if (Object.hasOwn(devices, data.deviceId)) { devices[data.deviceId].status = data.data; if (currentDeviceId === data.deviceId) { updateDeviceStatus(data.data); @@ -406,12 +406,12 @@ function renderDeviceList() {
- Type: ${device.info?.Type || "Unknown"}
+ Type: ${escapeHtml(device.info?.Type || "Unknown")}
Status: ${statusText}
Last Seen: ${lastSeen}
${info.Type || "Unknown Type"}
+${escapeHtml(info.Type || "Unknown Type")}
${nowPlaying.Artist || nowPlaying.artist || "Unknown artist"}
- ${nowPlaying.Album || nowPlaying.album || "Unknown album"} +${escapeHtml(nowPlaying.Artist || nowPlaying.artist || "Unknown artist")}
+ ${escapeHtml(nowPlaying.Album || nowPlaying.album || "Unknown album")}