Skip to content

fix: mms-2001 first step bridge #30644

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 28, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions ui/pages/bridge/transaction-details/bridge-step-description.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,14 @@ const getBridgeActionText = (
destNetworkConfiguration?.chainId as AllowedBridgeChainIds
];

const destSymbol = step?.destAsset?.symbol;
if (!destSymbol) {
return null;
}

Copy link
Contributor

@infiniteflower infiniteflower Feb 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we change the Step type as well? If these subfields are all marked with ?, then at least we can get type safety to catch these things before they hit production.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point; from my observations, both srcAsset and destAssert are built asynchronous, meaning you can still be fetching them when entering the page. Updates the types

In the following image, the srcAsset was being loaded.

Screenshot 2025-02-28 at 19 02 28

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) => {
Expand Down Expand Up @@ -115,15 +114,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 = ({
Expand Down
Loading