From f76cf6041a01fe62edf838df6b94b31c11612d16 Mon Sep 17 00:00:00 2001 From: SorinC6 Date: Tue, 12 Sep 2023 15:52:48 +0300 Subject: [PATCH] fix amount undefined --- .../CreateOrder/CreateOrder.tsx | 9 +- .../src/Dashboard/DashboardNavigator.json | 8 +- .../src/NftDetails/NftDetailsNavigator.json | 8 +- .../messages/src/Receive/Addresses.json | 24 ++-- .../ApplicationSettingsScreen.json | 120 ++++++++-------- .../DisableEasyConfirmationScreen.json | 16 +-- .../EnableEasyConfirmationScreen.json | 32 ++--- .../Settings/SettingsScreenNavigator.json | 128 +++++++++--------- .../WalletSettings/WalletSettingsScreen.json | 128 +++++++++--------- packages/swap/src/adapters/transformers.ts | 6 +- packages/swap/src/translators/reactjs.tsx | 1 + 11 files changed, 240 insertions(+), 240 deletions(-) diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/CreateOrder.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/CreateOrder.tsx index 30803b777b..5ab2ec916b 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/CreateOrder.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/CreateOrder.tsx @@ -40,14 +40,13 @@ export const CreateOrder = () => { const tokenInfos = useTokenInfos({ wallet, - tokenIds: [createOrder.amounts.buy.tokenId, createOrder.amounts.sell.tokenId], + tokenIds: [createOrder.amounts?.buy.tokenId, createOrder.amounts?.sell.tokenId], }) - const [showLimitPriceWarning, setShowLimitPriceWarning] = useState(false) const {isBuyTouched, isSellTouched, poolDefaulted} = useSwapTouched() const {poolList} = usePoolsByPair({ - tokenA: createOrder.amounts.sell.tokenId, - tokenB: createOrder.amounts.buy.tokenId, + tokenA: createOrder.amounts?.sell.tokenId ?? '', + tokenB: createOrder.amounts?.buy.tokenId ?? '', }) useEffect(() => { @@ -55,7 +54,7 @@ export const CreateOrder = () => { selectedPoolChanged(poolList[0]) poolDefaulted() } - }, [poolDefaulted, poolList, selectedPoolChanged]) + }, [poolDefaulted, selectedPoolChanged, createOrder.amounts, poolList]) const orderTypeLabels = [strings.marketButton, strings.limitButton] const orderTypeIndex = createOrder.type === 'market' ? 0 : 1 diff --git a/apps/wallet-mobile/translations/messages/src/Dashboard/DashboardNavigator.json b/apps/wallet-mobile/translations/messages/src/Dashboard/DashboardNavigator.json index dbb8d17888..ad01dbc5a3 100644 --- a/apps/wallet-mobile/translations/messages/src/Dashboard/DashboardNavigator.json +++ b/apps/wallet-mobile/translations/messages/src/Dashboard/DashboardNavigator.json @@ -4,14 +4,14 @@ "defaultMessage": "!!!Staking Center", "file": "src/Dashboard/DashboardNavigator.tsx", "start": { - "line": 63, + "line": 60, "column": 9, - "index": 1780 + "index": 1706 }, "end": { - "line": 66, + "line": 63, "column": 3, - "index": 1868 + "index": 1794 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/NftDetails/NftDetailsNavigator.json b/apps/wallet-mobile/translations/messages/src/NftDetails/NftDetailsNavigator.json index 66843d7e63..989b27305d 100644 --- a/apps/wallet-mobile/translations/messages/src/NftDetails/NftDetailsNavigator.json +++ b/apps/wallet-mobile/translations/messages/src/NftDetails/NftDetailsNavigator.json @@ -4,14 +4,14 @@ "defaultMessage": "!!!NFT Details", "file": "src/NftDetails/NftDetailsNavigator.tsx", "start": { - "line": 44, + "line": 43, "column": 9, - "index": 1259 + "index": 1213 }, "end": { - "line": 47, + "line": 46, "column": 3, - "index": 1330 + "index": 1284 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/Receive/Addresses.json b/apps/wallet-mobile/translations/messages/src/Receive/Addresses.json index 135158f84e..2f4b3f7f32 100644 --- a/apps/wallet-mobile/translations/messages/src/Receive/Addresses.json +++ b/apps/wallet-mobile/translations/messages/src/Receive/Addresses.json @@ -4,14 +4,14 @@ "defaultMessage": "!!!Unused addresses", "file": "src/Receive/Addresses.tsx", "start": { - "line": 158, + "line": 157, "column": 19, - "index": 4365 + "index": 4303 }, "end": { - "line": 161, + "line": 160, "column": 3, - "index": 4473 + "index": 4411 } }, { @@ -19,14 +19,14 @@ "defaultMessage": "!!!Used addresses", "file": "src/Receive/Addresses.tsx", "start": { - "line": 162, + "line": 161, "column": 17, - "index": 4492 + "index": 4430 }, "end": { - "line": 165, + "line": 164, "column": 3, - "index": 4596 + "index": 4534 } }, { @@ -34,14 +34,14 @@ "defaultMessage": "!!!Verify address", "file": "src/Receive/Addresses.tsx", "start": { - "line": 166, + "line": 165, "column": 17, - "index": 4615 + "index": 4553 }, "end": { - "line": 169, + "line": 168, "column": 3, - "index": 4719 + "index": 4657 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.json b/apps/wallet-mobile/translations/messages/src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.json index 13bd6958f3..779f2bef53 100644 --- a/apps/wallet-mobile/translations/messages/src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.json +++ b/apps/wallet-mobile/translations/messages/src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.json @@ -4,14 +4,14 @@ "defaultMessage": "!!!General", "file": "src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.tsx", "start": { - "line": 208, + "line": 199, "column": 11, - "index": 7138 + "index": 6731 }, "end": { - "line": 211, + "line": 202, "column": 3, - "index": 7248 + "index": 6841 } }, { @@ -19,14 +19,14 @@ "defaultMessage": "!!!Security & Reporting", "file": "src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.tsx", "start": { - "line": 212, + "line": 203, "column": 21, - "index": 7271 + "index": 6864 }, "end": { - "line": 215, + "line": 206, "column": 3, - "index": 7404 + "index": 6997 } }, { @@ -34,14 +34,14 @@ "defaultMessage": "!!!Language", "file": "src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.tsx", "start": { - "line": 216, + "line": 207, "column": 18, - "index": 7424 + "index": 7017 }, "end": { - "line": 219, + "line": 210, "column": 3, - "index": 7536 + "index": 7129 } }, { @@ -49,14 +49,14 @@ "defaultMessage": "!!!Fiat Currency", "file": "src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.tsx", "start": { - "line": 220, + "line": 211, "column": 22, - "index": 7560 + "index": 7153 }, "end": { - "line": 223, + "line": 214, "column": 3, - "index": 7681 + "index": 7274 } }, { @@ -64,14 +64,14 @@ "defaultMessage": "!!!About", "file": "src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.tsx", "start": { - "line": 224, + "line": 215, "column": 9, - "index": 7692 + "index": 7285 }, "end": { - "line": 227, + "line": 218, "column": 3, - "index": 7792 + "index": 7385 } }, { @@ -79,14 +79,14 @@ "defaultMessage": "!!!Terms of Service Agreement", "file": "src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.tsx", "start": { - "line": 228, + "line": 219, "column": 18, - "index": 7812 + "index": 7405 }, "end": { - "line": 231, + "line": 222, "column": 3, - "index": 7939 + "index": 7532 } }, { @@ -94,14 +94,14 @@ "defaultMessage": "!!!Change PIN", "file": "src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.tsx", "start": { - "line": 232, + "line": 223, "column": 13, - "index": 7954 + "index": 7547 }, "end": { - "line": 235, + "line": 226, "column": 3, - "index": 8063 + "index": 7656 } }, { @@ -109,14 +109,14 @@ "defaultMessage": "!!!Hide balance", "file": "src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.tsx", "start": { - "line": 236, + "line": 227, "column": 15, - "index": 8080 + "index": 7673 }, "end": { - "line": 239, + "line": 230, "column": 3, - "index": 8193 + "index": 7786 } }, { @@ -124,14 +124,14 @@ "defaultMessage": "!!!This function will be applied to all wallets in your app", "file": "src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.tsx", "start": { - "line": 240, + "line": 231, "column": 19, - "index": 8214 + "index": 7807 }, "end": { - "line": 243, + "line": 234, "column": 3, - "index": 8375 + "index": 7968 } }, { @@ -139,14 +139,14 @@ "defaultMessage": "!!!Sign in with your biometrics", "file": "src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.tsx", "start": { - "line": 244, + "line": 235, "column": 20, - "index": 8397 + "index": 7990 }, "end": { - "line": 247, + "line": 238, "column": 3, - "index": 8531 + "index": 8124 } }, { @@ -154,14 +154,14 @@ "defaultMessage": "!!!Changes to this option will be reflected after restarting the application", "file": "src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.tsx", "start": { - "line": 248, + "line": 239, "column": 24, - "index": 8557 + "index": 8150 }, "end": { - "line": 251, + "line": 242, "column": 3, - "index": 8740 + "index": 8333 } }, { @@ -169,14 +169,14 @@ "defaultMessage": "!!!Send crash report to Emurgo", "file": "src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.tsx", "start": { - "line": 252, + "line": 243, "column": 18, - "index": 8760 + "index": 8353 }, "end": { - "line": 255, + "line": 246, "column": 3, - "index": 8891 + "index": 8484 } }, { @@ -184,14 +184,14 @@ "defaultMessage": "!!!Changes to this option will be reflected after restarting the application", "file": "src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.tsx", "start": { - "line": 256, + "line": 247, "column": 22, - "index": 8915 + "index": 8508 }, "end": { - "line": 259, + "line": 250, "column": 3, - "index": 9096 + "index": 8689 } }, { @@ -199,14 +199,14 @@ "defaultMessage": "!!!Analytics", "file": "src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.tsx", "start": { - "line": 260, + "line": 251, "column": 13, - "index": 9111 + "index": 8704 }, "end": { - "line": 263, + "line": 254, "column": 3, - "index": 9219 + "index": 8812 } }, { @@ -214,14 +214,14 @@ "defaultMessage": "!!!Privacy Policy", "file": "src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.tsx", "start": { - "line": 264, + "line": 255, "column": 17, - "index": 9238 + "index": 8831 }, "end": { - "line": 267, + "line": 258, "column": 3, - "index": 9355 + "index": 8948 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/features/Settings/EasyConfirmation/DisableEasyConfirmationScreen.json b/apps/wallet-mobile/translations/messages/src/features/Settings/EasyConfirmation/DisableEasyConfirmationScreen.json index af98c7ba68..33bd665d7c 100644 --- a/apps/wallet-mobile/translations/messages/src/features/Settings/EasyConfirmation/DisableEasyConfirmationScreen.json +++ b/apps/wallet-mobile/translations/messages/src/features/Settings/EasyConfirmation/DisableEasyConfirmationScreen.json @@ -4,14 +4,14 @@ "defaultMessage": "!!!By disabling this option you will be able to spend your assets only with your master password.", "file": "src/features/Settings/EasyConfirmation/DisableEasyConfirmationScreen.tsx", "start": { - "line": 56, + "line": 61, "column": 18, - "index": 1836 + "index": 1897 }, "end": { - "line": 59, + "line": 64, "column": 3, - "index": 2038 + "index": 2099 } }, { @@ -19,14 +19,14 @@ "defaultMessage": "!!!Disable", "file": "src/features/Settings/EasyConfirmation/DisableEasyConfirmationScreen.tsx", "start": { - "line": 60, + "line": 65, "column": 17, - "index": 2057 + "index": 2118 }, "end": { - "line": 63, + "line": 68, "column": 3, - "index": 2171 + "index": 2232 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/features/Settings/EasyConfirmation/EnableEasyConfirmationScreen.json b/apps/wallet-mobile/translations/messages/src/features/Settings/EasyConfirmation/EnableEasyConfirmationScreen.json index 68a7350ece..4e4425b052 100644 --- a/apps/wallet-mobile/translations/messages/src/features/Settings/EasyConfirmation/EnableEasyConfirmationScreen.json +++ b/apps/wallet-mobile/translations/messages/src/features/Settings/EasyConfirmation/EnableEasyConfirmationScreen.json @@ -4,14 +4,14 @@ "defaultMessage": "!!!This option will allow you to send transactions from your wallet just by confirming with fingerprint or face recognition with standard system fallback option. This makes your wallet less secure. This is a compromise between UX and security!", "file": "src/features/Settings/EasyConfirmation/EnableEasyConfirmationScreen.tsx", "start": { - "line": 90, + "line": 91, "column": 17, - "index": 3118 + "index": 3141 }, "end": { - "line": 98, + "line": 99, "column": 3, - "index": 3514 + "index": 3537 } }, { @@ -19,14 +19,14 @@ "defaultMessage": "!!!Please remember your master password, as you may need it in case your biometrics data are removed from the device.", "file": "src/features/Settings/EasyConfirmation/EnableEasyConfirmationScreen.tsx", "start": { - "line": 99, + "line": 100, "column": 17, - "index": 3533 + "index": 3556 }, "end": { - "line": 104, + "line": 105, "column": 3, - "index": 3770 + "index": 3793 } }, { @@ -34,14 +34,14 @@ "defaultMessage": "!!!Master password", "file": "src/features/Settings/EasyConfirmation/EnableEasyConfirmationScreen.tsx", "start": { - "line": 105, + "line": 106, "column": 22, - "index": 3794 + "index": 3817 }, "end": { - "line": 108, + "line": 109, "column": 3, - "index": 3922 + "index": 3945 } }, { @@ -49,14 +49,14 @@ "defaultMessage": "!!!Enable", "file": "src/features/Settings/EasyConfirmation/EnableEasyConfirmationScreen.tsx", "start": { - "line": 109, + "line": 110, "column": 16, - "index": 3940 + "index": 3963 }, "end": { - "line": 112, + "line": 113, "column": 3, - "index": 4051 + "index": 4074 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/features/Settings/SettingsScreenNavigator.json b/apps/wallet-mobile/translations/messages/src/features/Settings/SettingsScreenNavigator.json index 8b7746d53c..0ae0763ed2 100644 --- a/apps/wallet-mobile/translations/messages/src/features/Settings/SettingsScreenNavigator.json +++ b/apps/wallet-mobile/translations/messages/src/features/Settings/SettingsScreenNavigator.json @@ -4,14 +4,14 @@ "defaultMessage": "!!!Wallet", "file": "src/features/Settings/SettingsScreenNavigator.tsx", "start": { - "line": 180, + "line": 178, "column": 18, - "index": 5568 + "index": 5506 }, "end": { - "line": 183, + "line": 181, "column": 3, - "index": 5666 + "index": 5604 } }, { @@ -19,14 +19,14 @@ "defaultMessage": "!!!Application", "file": "src/features/Settings/SettingsScreenNavigator.tsx", "start": { - "line": 184, + "line": 182, "column": 15, - "index": 5683 + "index": 5621 }, "end": { - "line": 187, + "line": 185, "column": 3, - "index": 5792 + "index": 5730 } }, { @@ -34,14 +34,14 @@ "defaultMessage": "!!!Change PIN", "file": "src/features/Settings/SettingsScreenNavigator.tsx", "start": { - "line": 188, + "line": 186, "column": 24, - "index": 5818 + "index": 5756 }, "end": { - "line": 191, + "line": 189, "column": 3, - "index": 5927 + "index": 5865 } }, { @@ -49,14 +49,14 @@ "defaultMessage": "!!!Change spending password", "file": "src/features/Settings/SettingsScreenNavigator.tsx", "start": { - "line": 192, + "line": 190, "column": 23, - "index": 5952 + "index": 5890 }, "end": { - "line": 195, + "line": 193, "column": 3, - "index": 6066 + "index": 6004 } }, { @@ -64,14 +64,14 @@ "defaultMessage": "!!!Remove wallet", "file": "src/features/Settings/SettingsScreenNavigator.tsx", "start": { - "line": 196, + "line": 194, "column": 21, - "index": 6089 + "index": 6027 }, "end": { - "line": 199, + "line": 197, "column": 3, - "index": 6190 + "index": 6128 } }, { @@ -79,14 +79,14 @@ "defaultMessage": "!!!Terms of Service Agreement", "file": "src/features/Settings/SettingsScreenNavigator.tsx", "start": { - "line": 200, + "line": 198, "column": 23, - "index": 6215 + "index": 6153 }, "end": { - "line": 203, + "line": 201, "column": 3, - "index": 6331 + "index": 6269 } }, { @@ -94,14 +94,14 @@ "defaultMessage": "!!!Change wallet name", "file": "src/features/Settings/SettingsScreenNavigator.tsx", "start": { - "line": 204, + "line": 202, "column": 25, - "index": 6358 + "index": 6296 }, "end": { - "line": 207, + "line": 205, "column": 3, - "index": 6462 + "index": 6400 } }, { @@ -109,14 +109,14 @@ "defaultMessage": "!!!Support", "file": "src/features/Settings/SettingsScreenNavigator.tsx", "start": { - "line": 208, + "line": 206, "column": 16, - "index": 6480 + "index": 6418 }, "end": { - "line": 211, + "line": 209, "column": 3, - "index": 6571 + "index": 6509 } }, { @@ -124,14 +124,14 @@ "defaultMessage": "!!!Easy confirmation", "file": "src/features/Settings/SettingsScreenNavigator.tsx", "start": { - "line": 212, + "line": 210, "column": 31, - "index": 6604 + "index": 6542 }, "end": { - "line": 215, + "line": 213, "column": 3, - "index": 6719 + "index": 6657 } }, { @@ -139,14 +139,14 @@ "defaultMessage": "!!!Easy confirmation", "file": "src/features/Settings/SettingsScreenNavigator.tsx", "start": { - "line": 216, + "line": 214, "column": 32, - "index": 6753 + "index": 6691 }, "end": { - "line": 219, + "line": 217, "column": 3, - "index": 6869 + "index": 6807 } }, { @@ -154,14 +154,14 @@ "defaultMessage": "!!!Set PIN", "file": "src/features/Settings/SettingsScreenNavigator.tsx", "start": { - "line": 220, + "line": 218, "column": 18, - "index": 6889 + "index": 6827 }, "end": { - "line": 223, + "line": 221, "column": 3, - "index": 6987 + "index": 6925 } }, { @@ -169,14 +169,14 @@ "defaultMessage": "!!!Settings", "file": "src/features/Settings/SettingsScreenNavigator.tsx", "start": { - "line": 224, + "line": 222, "column": 17, - "index": 7006 + "index": 6944 }, "end": { - "line": 227, + "line": 225, "column": 3, - "index": 7109 + "index": 7047 } }, { @@ -184,14 +184,14 @@ "defaultMessage": "!!!Language", "file": "src/features/Settings/SettingsScreenNavigator.tsx", "start": { - "line": 228, + "line": 226, "column": 17, - "index": 7128 + "index": 7066 }, "end": { - "line": 231, + "line": 229, "column": 3, - "index": 7226 + "index": 7164 } }, { @@ -199,14 +199,14 @@ "defaultMessage": "!!!App settings", "file": "src/features/Settings/SettingsScreenNavigator.tsx", "start": { - "line": 232, + "line": 230, "column": 20, - "index": 7248 + "index": 7186 }, "end": { - "line": 235, + "line": 233, "column": 3, - "index": 7366 + "index": 7304 } }, { @@ -214,14 +214,14 @@ "defaultMessage": "!!!About", "file": "src/features/Settings/SettingsScreenNavigator.tsx", "start": { - "line": 236, + "line": 234, "column": 14, - "index": 7382 + "index": 7320 }, "end": { - "line": 239, + "line": 237, "column": 3, - "index": 7482 + "index": 7420 } }, { @@ -229,14 +229,14 @@ "defaultMessage": "!!!Privacy Policy", "file": "src/features/Settings/SettingsScreenNavigator.tsx", "start": { - "line": 240, + "line": 238, "column": 22, - "index": 7506 + "index": 7444 }, "end": { - "line": 243, + "line": 241, "column": 3, - "index": 7609 + "index": 7547 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/features/Settings/WalletSettings/WalletSettingsScreen.json b/apps/wallet-mobile/translations/messages/src/features/Settings/WalletSettings/WalletSettingsScreen.json index c7df9fbfb6..64634b4ad8 100644 --- a/apps/wallet-mobile/translations/messages/src/features/Settings/WalletSettings/WalletSettingsScreen.json +++ b/apps/wallet-mobile/translations/messages/src/features/Settings/WalletSettings/WalletSettingsScreen.json @@ -4,14 +4,14 @@ "defaultMessage": "!!!General", "file": "src/features/Settings/WalletSettings/WalletSettingsScreen.tsx", "start": { - "line": 189, + "line": 201, "column": 11, - "index": 6078 + "index": 6627 }, "end": { - "line": 192, + "line": 204, "column": 3, - "index": 6176 + "index": 6725 } }, { @@ -19,14 +19,14 @@ "defaultMessage": "!!!Actions", "file": "src/features/Settings/WalletSettings/WalletSettingsScreen.tsx", "start": { - "line": 193, + "line": 205, "column": 11, - "index": 6189 + "index": 6738 }, "end": { - "line": 196, + "line": 208, "column": 3, - "index": 6287 + "index": 6836 } }, { @@ -34,14 +34,14 @@ "defaultMessage": "!!!Switch wallet", "file": "src/features/Settings/WalletSettings/WalletSettingsScreen.tsx", "start": { - "line": 197, + "line": 209, "column": 16, - "index": 6305 + "index": 6854 }, "end": { - "line": 200, + "line": 212, "column": 3, - "index": 6414 + "index": 6963 } }, { @@ -49,14 +49,14 @@ "defaultMessage": "!!!Logout", "file": "src/features/Settings/WalletSettings/WalletSettingsScreen.tsx", "start": { - "line": 201, + "line": 213, "column": 10, - "index": 6426 + "index": 6975 }, "end": { - "line": 204, + "line": 216, "column": 3, - "index": 6522 + "index": 7071 } }, { @@ -64,14 +64,14 @@ "defaultMessage": "!!!Wallet name", "file": "src/features/Settings/WalletSettings/WalletSettingsScreen.tsx", "start": { - "line": 205, + "line": 217, "column": 14, - "index": 6538 + "index": 7087 }, "end": { - "line": 208, + "line": 220, "column": 3, - "index": 6643 + "index": 7192 } }, { @@ -79,14 +79,14 @@ "defaultMessage": "!!!Security", "file": "src/features/Settings/WalletSettings/WalletSettingsScreen.tsx", "start": { - "line": 209, + "line": 221, "column": 12, - "index": 6657 + "index": 7206 }, "end": { - "line": 212, + "line": 224, "column": 3, - "index": 6757 + "index": 7306 } }, { @@ -94,14 +94,14 @@ "defaultMessage": "!!!Change password", "file": "src/features/Settings/WalletSettings/WalletSettingsScreen.tsx", "start": { - "line": 213, + "line": 225, "column": 18, - "index": 6777 + "index": 7326 }, "end": { - "line": 216, + "line": 228, "column": 3, - "index": 6890 + "index": 7439 } }, { @@ -109,14 +109,14 @@ "defaultMessage": "!!!Easy transaction confirmation", "file": "src/features/Settings/WalletSettings/WalletSettingsScreen.tsx", "start": { - "line": 217, + "line": 229, "column": 20, - "index": 6912 + "index": 7461 }, "end": { - "line": 220, + "line": 232, "column": 3, - "index": 7041 + "index": 7590 } }, { @@ -124,14 +124,14 @@ "defaultMessage": "!!!Remove wallet", "file": "src/features/Settings/WalletSettings/WalletSettingsScreen.tsx", "start": { - "line": 221, + "line": 233, "column": 16, - "index": 7059 + "index": 7608 }, "end": { - "line": 224, + "line": 236, "column": 3, - "index": 7168 + "index": 7717 } }, { @@ -139,14 +139,14 @@ "defaultMessage": "!!!Network:", "file": "src/features/Settings/WalletSettings/WalletSettingsScreen.tsx", "start": { - "line": 226, + "line": 238, "column": 11, - "index": 7229 + "index": 7778 }, "end": { - "line": 229, + "line": 241, "column": 3, - "index": 7295 + "index": 7844 } }, { @@ -154,14 +154,14 @@ "defaultMessage": "!!!Wallet type:", "file": "src/features/Settings/WalletSettings/WalletSettingsScreen.tsx", "start": { - "line": 230, + "line": 242, "column": 14, - "index": 7311 + "index": 7860 }, "end": { - "line": 233, + "line": 245, "column": 3, - "index": 7417 + "index": 7966 } }, { @@ -169,14 +169,14 @@ "defaultMessage": "!!!Byron-era wallet", "file": "src/features/Settings/WalletSettings/WalletSettingsScreen.tsx", "start": { - "line": 234, + "line": 246, "column": 15, - "index": 7434 + "index": 7983 }, "end": { - "line": 237, + "line": 249, "column": 3, - "index": 7545 + "index": 8094 } }, { @@ -184,14 +184,14 @@ "defaultMessage": "!!!Shelley-era wallet", "file": "src/features/Settings/WalletSettings/WalletSettingsScreen.tsx", "start": { - "line": 238, + "line": 250, "column": 17, - "index": 7564 + "index": 8113 }, "end": { - "line": 241, + "line": 253, "column": 3, - "index": 7679 + "index": 8228 } }, { @@ -199,14 +199,14 @@ "defaultMessage": "!!!Unknown Wallet Type", "file": "src/features/Settings/WalletSettings/WalletSettingsScreen.tsx", "start": { - "line": 242, + "line": 254, "column": 21, - "index": 7702 + "index": 8251 }, "end": { - "line": 245, + "line": 257, "column": 3, - "index": 7822 + "index": 8371 } }, { @@ -214,14 +214,14 @@ "defaultMessage": "!!!About", "file": "src/features/Settings/WalletSettings/WalletSettingsScreen.tsx", "start": { - "line": 246, + "line": 258, "column": 9, - "index": 7833 + "index": 8382 }, "end": { - "line": 249, + "line": 261, "column": 3, - "index": 7927 + "index": 8476 } }, { @@ -229,14 +229,14 @@ "defaultMessage": "!!!Resync", "file": "src/features/Settings/WalletSettings/WalletSettingsScreen.tsx", "start": { - "line": 250, + "line": 262, "column": 10, - "index": 7939 + "index": 8488 }, "end": { - "line": 253, + "line": 265, "column": 3, - "index": 8041 + "index": 8590 } } ] \ No newline at end of file diff --git a/packages/swap/src/adapters/transformers.ts b/packages/swap/src/adapters/transformers.ts index 3de7ffbb0d..cf8ff75ad0 100644 --- a/packages/swap/src/adapters/transformers.ts +++ b/packages/swap/src/adapters/transformers.ts @@ -124,8 +124,8 @@ export const asYoroiAmount = (openswapAmount: { amount: string token: string }): Balance.Amount => { - const {amount, token} = openswapAmount - if (amount) { + if (openswapAmount !== null && openswapAmount?.amount !== null) { + const {amount, token} = openswapAmount const [policyId = '', assetName = ''] = token.split('.') const subject = `${policyId}.${assetName}` return { @@ -137,7 +137,7 @@ export const asYoroiAmount = (openswapAmount: { } export const asYoroiPools = (openswapPools: Pool[]): Swap.PoolPair[] => { - return openswapPools.map(asYoroiPool) + return openswapPools?.length > 0 ? openswapPools.map(asYoroiPool) : [] } export const asYoroiBalanceTokens = ( diff --git a/packages/swap/src/translators/reactjs.tsx b/packages/swap/src/translators/reactjs.tsx index aaa5921434..ffbb119b43 100644 --- a/packages/swap/src/translators/reactjs.tsx +++ b/packages/swap/src/translators/reactjs.tsx @@ -234,6 +234,7 @@ export const usePoolsByPair = ( const query = useQuery({ suspense: true, ...options, + enabled: tokenPair?.tokenA !== undefined && tokenPair?.tokenB !== undefined, queryKey: ['usePoolsByPair', tokenPair], queryFn: () => pools.list.byPair(tokenPair), })