Skip to content

Commit 1834df9

Browse files
committed
null to ??
1 parent f4ebd5d commit 1834df9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

frontend/src/hooks/useSettings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const setLocalStorageItem = <T>(key: string, value: T): void => {
1212
const useSettings = <T>(key: string, defaultValue: T): [T, (value: T) => void, () => void] => {
1313
const [setting, setSetting] = useState<T>(() => {
1414
const storedValue = getLocalStorageItem<T>(key)
15-
return storedValue !== null ? storedValue : defaultValue
15+
return storedValue ?? defaultValue
1616
})
1717

1818
const saveSetting = (value: T): void => {

0 commit comments

Comments
 (0)