diff --git a/shared/types/bridge-status.ts b/shared/types/bridge-status.ts index 5c536c4e0eff..9a33a2082a26 100644 --- a/shared/types/bridge-status.ts +++ b/shared/types/bridge-status.ts @@ -115,8 +115,8 @@ export type Step = { action: ActionTypes; srcChainId: ChainId; destChainId?: ChainId; - srcAsset: Asset; - destAsset: Asset; + srcAsset?: Asset; + destAsset?: Asset; srcAmount: string; destAmount: string; protocol: Protocol; diff --git a/shared/types/bridge.ts b/shared/types/bridge.ts index ce9b3e509abd..e91ab9e69468 100644 --- a/shared/types/bridge.ts +++ b/shared/types/bridge.ts @@ -117,8 +117,8 @@ type Step = { action: ActionTypes; srcChainId: ChainId; destChainId?: ChainId; - srcAsset: BridgeAsset; - destAsset: BridgeAsset; + srcAsset?: BridgeAsset; + destAsset?: BridgeAsset; srcAmount: string; destAmount: string; protocol: Protocol; diff --git a/ui/pages/bridge/transaction-details/bridge-step-description.tsx b/ui/pages/bridge/transaction-details/bridge-step-description.tsx index 5db44b8a20bc..9bab69847946 100644 --- a/ui/pages/bridge/transaction-details/bridge-step-description.tsx +++ b/ui/pages/bridge/transaction-details/bridge-step-description.tsx @@ -58,15 +58,15 @@ const getBridgeActionText = ( destNetworkConfiguration?.chainId as AllowedBridgeChainIds ]; + const destSymbol = step.destAsset?.symbol; + + if (!destSymbol) { + return null; + } + return stepStatus === StatusTypes.COMPLETE - ? t('bridgeStepActionBridgeComplete', [ - step.destAsset.symbol, - destChainName, - ]) - : t('bridgeStepActionBridgePending', [ - step.destAsset.symbol, - destChainName, - ]); + ? t('bridgeStepActionBridgeComplete', [destSymbol, destChainName]) + : t('bridgeStepActionBridgePending', [destSymbol, destChainName]); }; const getBridgeActionStatus = (bridgeHistoryItem: BridgeHistoryItem) => { @@ -115,15 +115,16 @@ const getSwapActionText = ( status: StatusTypes | null, step: Step, ) => { + const srcSymbol = step.srcAsset?.symbol; + const destSymbol = step.destAsset?.symbol; + + if (!srcSymbol || !destSymbol) { + return null; + } + return status === StatusTypes.COMPLETE - ? t('bridgeStepActionSwapComplete', [ - step.srcAsset.symbol, - step.destAsset.symbol, - ]) - : t('bridgeStepActionSwapPending', [ - step.srcAsset.symbol, - step.destAsset.symbol, - ]); + ? t('bridgeStepActionSwapComplete', [srcSymbol, destSymbol]) + : t('bridgeStepActionSwapPending', [srcSymbol, destSymbol]); }; export const getStepStatus = ({