♻️ (synced-prefs) refactor some SyncedPrefs to string type (#3395)

This commit is contained in:
Matiss Janis Aboltins
2024-09-08 21:42:34 +01:00
committed by GitHub
parent 21dc573f3f
commit 95ed7aaf27
21 changed files with 125 additions and 97 deletions

View File

@@ -63,7 +63,7 @@ export function AmountInput({
const buttonRef = useRef();
const ref = useRef<HTMLInputElement>(null);
const mergedRef = useMergedRefs<HTMLInputElement>(inputRef, ref);
const [hideFraction = false] = useSyncedPref('hideFraction');
const [hideFraction] = useSyncedPref('hideFraction');
useEffect(() => {
if (focused) {
@@ -81,7 +81,9 @@ export function AmountInput({
}
function onInputTextChange(val) {
val = autoDecimals ? appendDecimals(val, hideFraction) : val;
val = autoDecimals
? appendDecimals(val, String(hideFraction) === 'true')
: val;
setValue(val ? val : '');
onChangeValue?.(val);
}