fix: restore \$state on SvelteMap in device-mapping-dialog

The variable is fully reassigned in an \$effect, so \$state is required
for reactivity. Suppress the no-unnecessary-state-wrap lint rule with a
comment explaining the reason.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 11:47:21 +01:00
parent 446e9f835b
commit 627ce75719

View File

@@ -16,7 +16,8 @@
let { open, recordedDevices, connectedDevices, onConfirm, onCancel }: Props = $props(); let { open, recordedDevices, connectedDevices, onConfirm, onCancel }: Props = $props();
// Device mappings: recorded device name -> connected device // Device mappings: recorded device name -> connected device
let mappings = new SvelteMap<string, BluetoothDevice>(); // eslint-disable-next-line svelte/no-unnecessary-state-wrap -- variable is reassigned in $effect, $state is required
let mappings = $state(new SvelteMap<string, BluetoothDevice>());
// Check if a connected device is compatible with a recorded device // Check if a connected device is compatible with a recorded device
function isCompatible(recordedDevice: DeviceInfo, connectedDevice: BluetoothDevice): boolean { function isCompatible(recordedDevice: DeviceInfo, connectedDevice: BluetoothDevice): boolean {