diff --git a/apps/app/components/WrapDecimal.tsx b/apps/app/components/WrapDecimal.tsx index da2b0461..1d68f552 100644 --- a/apps/app/components/WrapDecimal.tsx +++ b/apps/app/components/WrapDecimal.tsx @@ -2,6 +2,7 @@ import {Box} from '@mui/material' import {type FC, Fragment, type ReactNode, useMemo} from 'react' const regex = /(\d+\.\d+)/g + const WrapDecimal: FC<{children: ReactNode}> = ({children}) => { const parts = useMemo(() => { if (typeof children === 'string') { @@ -10,25 +11,30 @@ const WrapDecimal: FC<{children: ReactNode}> = ({children}) => { return [] }, [children]) + if (parts.length === 0) { + return children + } + return ( <> - {typeof children === 'string' - ? parts.map((part, index) => { - if (part.match(regex) != null) { - const [integer, decimal] = part.split('.') - return ( - // biome-ignore lint/suspicious/noArrayIndexKey: the order of parts will not change - - {integer}. - - {decimal} - - - ) - } - return part - }) - : children} + {parts.map((part, index) => { + if (regex.test(part)) { + const [integer, decimal] = part.split('.') + return ( + + {integer}. + + {decimal} + + + ) + } + // biome-ignore lint/suspicious/noArrayIndexKey: + return {part} + })} ) } diff --git a/apps/app/hooks/useSignAndSend.tsx b/apps/app/hooks/useSignAndSend.tsx index 49584229..77140291 100644 --- a/apps/app/hooks/useSignAndSend.tsx +++ b/apps/app/hooks/useSignAndSend.tsx @@ -62,7 +62,11 @@ const useSignAndSend = (): (( .catch((err) => { reject(err) closeSnackbar(snackbarKey) - if (err.message != null && err.message !== 'Cancelled') { + if ( + err instanceof Error && + err.message != null && + err.message !== 'Cancelled' + ) { enqueueSnackbar( {name} diff --git a/bun.lockb b/bun.lockb index fa44e826..dbe109c6 100755 Binary files a/bun.lockb and b/bun.lockb differ