Fix link and currency input (#2697)

* fix link focus

* fix currency value null

* fix currency code nullable

* change in progress

* currency is working

* modify path
This commit is contained in:
bosiraphael
2023-11-24 15:19:29 +01:00
committed by GitHub
parent 323c69948c
commit cf1b0bfccf
9 changed files with 84 additions and 70 deletions

View File

@ -1,10 +1,8 @@
import { isUndefined } from '@sniptt/guards';
export const convertCurrencyToCurrencyMicros = (
currencyAmount: number | undefined,
currencyAmount: number | null | undefined,
) => {
if (!currencyAmount) {
return undefined;
if (currencyAmount == null) {
return null;
}
const currencyAmountAsNumber = +currencyAmount;
if (isNaN(currencyAmountAsNumber)) {
@ -18,10 +16,10 @@ export const convertCurrencyToCurrencyMicros = (
};
export const convertCurrencyMicrosToCurrency = (
currencyAmountMicros: number | undefined,
currencyAmountMicros: number | null | undefined,
) => {
if (isUndefined(currencyAmountMicros)) {
return undefined;
if (currencyAmountMicros == null) {
return null;
}
const currencyAmountMicrosAsNumber = +currencyAmountMicros;
if (isNaN(currencyAmountMicrosAsNumber)) {