From 7892480851effe0ff49cda6f8227daa751303139 Mon Sep 17 00:00:00 2001 From: DMY <147dmy@gmail.com> Date: Tue, 3 Sep 2024 17:48:21 +0800 Subject: [PATCH] fix --- _raw/locales/en/messages.json | 1 + src/ui/utils/number.ts | 3 ++ src/ui/views/AddressManagement/index.tsx | 2 +- .../components/FooterBar/FooterBar.tsx | 5 ++- .../FooterBar/GasLessComponents.tsx | 19 ++++----- .../components/MiniSignTx/MiniFooterBar.tsx | 5 ++- .../Approval/components/MiniSignTx/index.tsx | 1 + src/ui/views/Approval/components/SignTx.tsx | 1 + .../TxComponents/GasSelectorHeader.tsx | 39 +++++++++++-------- .../components/GasAccountTxPopups.tsx | 9 +++-- .../GasAccount/components/LoginPopup.tsx | 2 +- src/ui/views/GasAccount/hooks/checkTxs.ts | 2 +- src/ui/views/GasAccount/hooks/index.ts | 8 +++- src/ui/views/GasAccount/index.tsx | 5 ++- 14 files changed, 65 insertions(+), 37 deletions(-) diff --git a/_raw/locales/en/messages.json b/_raw/locales/en/messages.json index 217de414d5c..9aa3447c102 100644 --- a/_raw/locales/en/messages.json +++ b/_raw/locales/en/messages.json @@ -351,6 +351,7 @@ "watchUnavailableTip": "Watch-only address is not supported for Free Gas" }, "gasAccount": { + "customRPC": "Not supported when using custom RPC", "notEnough": "Gas balance is not enough", "useGasAccount": "Use GasAccount", "WalletConnectTips": "WalletConnect is not supported by GasAccount", diff --git a/src/ui/utils/number.ts b/src/ui/utils/number.ts index 6559a07db72..c703d0bdf29 100644 --- a/src/ui/utils/number.ts +++ b/src/ui/utils/number.ts @@ -32,6 +32,9 @@ export const formatTokenAmount = ( if (moreDecimalsWhenNotEnough && bn.lt(0.0001) && decimals < 8) { realDecimals = 8; } + if (moreDecimalsWhenNotEnough && bn.lt(0.00000001)) { + return '<0.00000001'; + } if (!split[1] || split[1].length < realDecimals) { return splitNumberByStep(bn.toFixed()); } diff --git a/src/ui/views/AddressManagement/index.tsx b/src/ui/views/AddressManagement/index.tsx index 25efc919120..186dd08411d 100644 --- a/src/ui/views/AddressManagement/index.tsx +++ b/src/ui/views/AddressManagement/index.tsx @@ -515,7 +515,7 @@ const AddressManagement = () => { {enableSwitch ? t('page.manageAddress.current-address') : t('page.manageAddress.address-management')} -