From 0e830ee0a6ed0aba03b0d54ca5273a23602aa132 Mon Sep 17 00:00:00 2001 From: mrjvs Date: Thu, 21 Dec 2023 21:00:36 +0100 Subject: [PATCH] Fix settings toggles sometimes not being toggable Co-authored-by: William Oldham --- src/hooks/useSettingsState.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useSettingsState.ts b/src/hooks/useSettingsState.ts index 4f755205..5f0c823c 100644 --- a/src/hooks/useSettingsState.ts +++ b/src/hooks/useSettingsState.ts @@ -24,7 +24,7 @@ export function useDerived( const setter = useCallback>>( (inp) => { if (!(inp instanceof Function)) setOverwrite(inp); - else setOverwrite((s) => inp(s ?? initial)); + else setOverwrite((s) => inp(s !== undefined ? s : initial)); }, [initial, setOverwrite] );