From 523efd246771c239ffb311e45f3faf0b9768bb53 Mon Sep 17 00:00:00 2001 From: Lyka Labrada Date: Mon, 9 Oct 2023 11:22:45 +0800 Subject: [PATCH] add default target evm token --- .../screens/Portfolio/screens/ConvertScreen.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/ConvertScreen.tsx b/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/ConvertScreen.tsx index 04603b0782..eab26185a8 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/ConvertScreen.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/ConvertScreen.tsx @@ -225,9 +225,18 @@ export function ConvertScreen(props: Props): JSX.Element { function getListByDomain(listType: TokenListType): DomainToken[] { if (listType === TokenListType.To) { + const defaultEvmTargetToken = { + tokenId: `${sourceToken.tokenId}-EVM`, + available: sourceToken.available, + token: { + ...sourceToken.token, + name: `${sourceToken.token.name} for EVM`, + domainType: DomainType.EVM, + }, + }; if (domain === DomainType.DVM && sourceToken.tokenId === "0") { return [ - ...evmTokens.filter((token) => token.tokenId === "0-EVM"), + defaultEvmTargetToken, ...dvmTokens.filter((token) => token.tokenId === "0_utxo"), ]; } else if ( @@ -235,6 +244,8 @@ export function ConvertScreen(props: Props): JSX.Element { sourceToken.tokenId === "0_utxo" ) { return dvmTokens.filter((token) => token.tokenId === "0"); + } else if (domain === DomainType.DVM) { + return [defaultEvmTargetToken]; } else if (domain === DomainType.EVM && sourceToken.tokenId === "0-EVM") { return dvmTokens.filter((token) => token.tokenId === "0"); }