mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 06:40:00 -07:00
Fix SDR device type not synced on page refresh
Initialize currentDeviceList from server-provided deviceList on page load and auto-select the correct hardware type dropdown value. Previously the device list was empty until "Refresh Devices" was clicked, causing the hardware type dropdown to show incorrect values. Fixes #99 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2418,6 +2418,19 @@
|
||||
// Load bias-T setting from localStorage
|
||||
loadBiasTSetting();
|
||||
|
||||
// Initialize device list from server-provided data
|
||||
// This ensures currentDeviceList is populated on page load (fixes #99)
|
||||
if (typeof deviceList !== 'undefined' && deviceList.length > 0) {
|
||||
currentDeviceList = deviceList;
|
||||
const firstType = deviceList[0].sdr_type || 'rtlsdr';
|
||||
const sdrTypeSelect = document.getElementById('sdrTypeSelect');
|
||||
if (sdrTypeSelect) {
|
||||
sdrTypeSelect.value = firstType;
|
||||
}
|
||||
// Defer onSDRTypeChanged to ensure DOM is ready
|
||||
setTimeout(onSDRTypeChanged, 0);
|
||||
}
|
||||
|
||||
// Initialize observer location input fields from saved location
|
||||
const obsLatInput = document.getElementById('obsLat');
|
||||
const obsLonInput = document.getElementById('obsLon');
|
||||
|
||||
Reference in New Issue
Block a user