fix: select component reactivity in device mapping dialog
- Create new Map instance in handleDeviceSelect to trigger Svelte 5 reactivity - Fixes issue where user selection wasn't updating the UI - Ensures device mappings update correctly when user chooses from dropdown
This commit is contained in:
@@ -73,7 +73,9 @@ function handleConfirm() {
|
|||||||
function handleDeviceSelect(recordedDeviceName: string, selectedDeviceId: string) {
|
function handleDeviceSelect(recordedDeviceName: string, selectedDeviceId: string) {
|
||||||
const device = connectedDevices.find(d => d.id === selectedDeviceId);
|
const device = connectedDevices.find(d => d.id === selectedDeviceId);
|
||||||
if (device) {
|
if (device) {
|
||||||
mappings.set(recordedDeviceName, device);
|
const newMappings = new Map(mappings);
|
||||||
|
newMappings.set(recordedDeviceName, device);
|
||||||
|
mappings = newMappings;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user