build fix

This commit is contained in:
2026-01-13 13:18:46 +01:00
parent a69b4c0bcb
commit bbb767cd20
4 changed files with 61 additions and 31 deletions

View File

@@ -1050,6 +1050,17 @@ function setupEventListeners() {
await appWindow.close();
});
// Listen for cast device discovery events from backend
if (runningInTauri && window.__TAURI__ && window.__TAURI__.event) {
window.__TAURI__.event.listen('cast-device-discovered', (event) => {
console.log('Cast device discovered:', event.payload);
// If cast overlay is currently open, refresh the device list
if (!castOverlay.classList.contains('hidden')) {
refreshCastDeviceList();
}
});
}
// Menu button - explicit functionality or placeholder?
// Menu removed — header click opens stations via artwork placeholder
@@ -1353,6 +1364,10 @@ async function openCastOverlay() {
castOverlay.setAttribute('aria-hidden', 'false');
// ensure cast overlay shows linear list style
deviceListEl.classList.remove('stations-grid');
await refreshCastDeviceList();
}
async function refreshCastDeviceList() {
deviceListEl.innerHTML = '<li class="device"><div class="device-main">Scanning...</div><div class="device-sub">Searching for speakers</div></li>';
try {