From b407bfda07ff50bf9ab35141809ac4c030a03cd4 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Wed, 25 Jun 2025 21:35:33 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(frontend)=20default=20noise=20redu?= =?UTF-8?q?ction=20to=20disabled=20for=20existing=20users?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prevent React warnings about uncontrolled/controlled components by ensuring lk-user-choice store initializes with default value when noise reduction setting is missing from existing localStorage. --- src/frontend/src/stores/userChoices.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/stores/userChoices.ts b/src/frontend/src/stores/userChoices.ts index d5ace2ce..b0ce11f8 100644 --- a/src/frontend/src/stores/userChoices.ts +++ b/src/frontend/src/stores/userChoices.ts @@ -12,7 +12,10 @@ export type LocalUserChoices = LocalUserChoicesLK & { } function getUserChoicesState(): LocalUserChoices { - return loadUserChoices() + return { + noiseReductionEnabled: false, + ...loadUserChoices(), + } } export const userChoicesStore = proxy(getUserChoicesState())