mirror of
https://github.com/movie-web/movie-web.git
synced 2024-11-11 02:25:08 +01:00
Fix settings toggles sometimes not being toggable
Co-authored-by: William Oldham <github@binaryoverload.co.uk>
This commit is contained in:
parent
690b1c6e68
commit
0e830ee0a6
@ -24,7 +24,7 @@ export function useDerived<T>(
|
||||
const setter = useCallback<Dispatch<SetStateAction<T>>>(
|
||||
(inp) => {
|
||||
if (!(inp instanceof Function)) setOverwrite(inp);
|
||||
else setOverwrite((s) => inp(s ?? initial));
|
||||
else setOverwrite((s) => inp(s !== undefined ? s : initial));
|
||||
},
|
||||
[initial, setOverwrite]
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user