From 627ce75719a1d06b33f88e8224de574a934e1c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Sun, 8 Mar 2026 11:47:21 +0100 Subject: [PATCH] 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 --- .../src/routes/play/components/device-mapping-dialog.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/routes/play/components/device-mapping-dialog.svelte b/packages/frontend/src/routes/play/components/device-mapping-dialog.svelte index 7401d6a..000c3ab 100644 --- a/packages/frontend/src/routes/play/components/device-mapping-dialog.svelte +++ b/packages/frontend/src/routes/play/components/device-mapping-dialog.svelte @@ -16,7 +16,8 @@ let { open, recordedDevices, connectedDevices, onConfirm, onCancel }: Props = $props(); // Device mappings: recorded device name -> connected device - let mappings = new SvelteMap(); + // eslint-disable-next-line svelte/no-unnecessary-state-wrap -- variable is reassigned in $effect, $state is required + let mappings = $state(new SvelteMap()); // Check if a connected device is compatible with a recorded device function isCompatible(recordedDevice: DeviceInfo, connectedDevice: BluetoothDevice): boolean {