mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-30 03:23:51 -05:00
♻️ (synced-prefs) refactor some SyncedPrefs to string type (#3395)
This commit is contained in:
committed by
GitHub
parent
21dc573f3f
commit
95ed7aaf27
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user