🐛(frontend) default noise reduction to disabled for existing users

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.
This commit is contained in:
lebaudantoine
2025-06-25 21:35:33 +02:00
committed by aleb_the_flash
parent 3de4cc01dc
commit b407bfda07

View File

@@ -12,7 +12,10 @@ export type LocalUserChoices = LocalUserChoicesLK & {
}
function getUserChoicesState(): LocalUserChoices {
return loadUserChoices()
return {
noiseReductionEnabled: false,
...loadUserChoices(),
}
}
export const userChoicesStore = proxy<LocalUserChoices>(getUserChoicesState())