From 209f2afd3d4dae75896d8911dc18043b3e48f61d Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Fri, 23 Oct 2020 11:41:10 -0230 Subject: [PATCH] Fix PropType error on Awaiting Swap page (#9688) A PropType error was shown in the console when on the Awaiting Swap page in certain error scenarios. The `symbol` property was sometimes not set if `destinationTokenInfo` was missing. The `symbol` prop has been removed, as the `AwaitingSwap` component already selected the `fetchParams`, and the `destinationTokenInfo` object within. The prop was effectively a duplicate. --- ui/app/pages/swaps/awaiting-swap/awaiting-swap.js | 8 +++----- ui/app/pages/swaps/awaiting-swap/awaiting-swap.stories.js | 3 --- ui/app/pages/swaps/index.js | 3 --- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/ui/app/pages/swaps/awaiting-swap/awaiting-swap.js b/ui/app/pages/swaps/awaiting-swap/awaiting-swap.js index 8f1053715..ba123be40 100644 --- a/ui/app/pages/swaps/awaiting-swap/awaiting-swap.js +++ b/ui/app/pages/swaps/awaiting-swap/awaiting-swap.js @@ -41,7 +41,6 @@ import ViewOnEtherScanLink from './view-on-ether-scan-link' export default function AwaitingSwap ({ swapComplete, errorKey, - symbol, txHash, networkId, tokensReceived, @@ -189,7 +188,7 @@ export default function AwaitingSwap ({ headerText = t('swapProcessing') statusImage = submitText = t('swapsViewInActivity') - descriptionText = t('swapOnceTransactionHasProcess', [{symbol}]) + descriptionText = t('swapOnceTransactionHasProcess', [{destinationTokenInfo.symbol}]) content = ( <>
- submitText = t('swapViewToken', [symbol]) - descriptionText = t('swapTokenAvailable', [{`${tokensReceived || ''} ${symbol}`}]) + submitText = t('swapViewToken', [destinationTokenInfo.symbol]) + descriptionText = t('swapTokenAvailable', [{`${tokensReceived || ''} ${destinationTokenInfo.symbol}`}]) content = blockExplorerUrl && ( ( ERROR_FETCHING_QUOTES, QUOTES_NOT_AVAILABLE_ERROR, ], '')} - symbol="ABC" estimatedTime="2 minutes" networkId="1" txHash="0xnotATx" @@ -45,7 +44,6 @@ export const swapComplete = () => ( ERROR_FETCHING_QUOTES, QUOTES_NOT_AVAILABLE_ERROR, ], '')} - symbol="ABC" estimatedTime={null} tokensReceived={320.68} networkId="1" @@ -66,7 +64,6 @@ export const swapError = () => ( ERROR_FETCHING_QUOTES, QUOTES_NOT_AVAILABLE_ERROR, ], '')} - symbol="ABC" estimatedTime={null} networkId="1" txHash="0xnotATx" diff --git a/ui/app/pages/swaps/index.js b/ui/app/pages/swaps/index.js index 9b6396f6f..f35060b2d 100644 --- a/ui/app/pages/swaps/index.js +++ b/ui/app/pages/swaps/index.js @@ -298,7 +298,6 @@ export default function Swap () { @@ -360,7 +358,6 @@ export default function Swap () { ? (