From bb92400cf8243ec1df89a08810bd5b6788e25575 Mon Sep 17 00:00:00 2001 From: LFBarreto Date: Wed, 10 Aug 2022 15:24:59 +0200 Subject: [PATCH] LIVE-3199 - LLm - Receive flow fix isue on receive from market page --- .changeset/gentle-ties-pretend.md | 5 +++++ .../src/components/FabAccountButtonBar.tsx | 7 +++++-- apps/ledger-live-mobile/src/components/FabActions.tsx | 5 ++++- .../src/screens/ReceiveFunds/03-Confirmation.tsx | 10 ++++++++-- 4 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 .changeset/gentle-ties-pretend.md diff --git a/.changeset/gentle-ties-pretend.md b/.changeset/gentle-ties-pretend.md new file mode 100644 index 000000000000..e091b410451f --- /dev/null +++ b/.changeset/gentle-ties-pretend.md @@ -0,0 +1,5 @@ +--- +"live-mobile": patch +--- + +LLM - Receive flow fix issue on receive token accounts from market page diff --git a/apps/ledger-live-mobile/src/components/FabAccountButtonBar.tsx b/apps/ledger-live-mobile/src/components/FabAccountButtonBar.tsx index 6012395ba891..673ee9bc5b37 100644 --- a/apps/ledger-live-mobile/src/components/FabAccountButtonBar.tsx +++ b/apps/ledger-live-mobile/src/components/FabAccountButtonBar.tsx @@ -69,8 +69,11 @@ function FabAccountButtonBar({ const onNavigate = useCallback( (name: string, options?: any) => { - const accountId = account ? account.id : undefined; - const parentId = parentAccount ? parentAccount.id : undefined; + const accountId = account ? account.id : options?.params?.accountId; + const parentId = parentAccount + ? parentAccount.id + : options?.params?.parentId; + navigation.navigate(name, { ...options, params: { diff --git a/apps/ledger-live-mobile/src/components/FabActions.tsx b/apps/ledger-live-mobile/src/components/FabActions.tsx index cc615ae3886f..cf90eb5692f9 100644 --- a/apps/ledger-live-mobile/src/components/FabActions.tsx +++ b/apps/ledger-live-mobile/src/components/FabActions.tsx @@ -263,7 +263,10 @@ const FabMarketActionsComponent: React.FC = ({ NavigatorName.ReceiveFunds, { screen: ScreenName.ReceiveConfirmation, - params: { currency, account: accounts?.[0] }, + params: { + parentId: defaultAccount?.parentId, + accountId: defaultAccount.id, + }, }, ], }, diff --git a/apps/ledger-live-mobile/src/screens/ReceiveFunds/03-Confirmation.tsx b/apps/ledger-live-mobile/src/screens/ReceiveFunds/03-Confirmation.tsx index a189db44859b..9f1c69778f46 100644 --- a/apps/ledger-live-mobile/src/screens/ReceiveFunds/03-Confirmation.tsx +++ b/apps/ledger-live-mobile/src/screens/ReceiveFunds/03-Confirmation.tsx @@ -55,9 +55,15 @@ type RouteParams = { onError?: () => void, }; -export default function ReceiveConfirmation({ navigation, route }: Props) { - const { colors } = useTheme(); +export default function ReceiveConfirmation({ navigation }: Props) { + const route = useRoute(); const { account, parentAccount } = useSelector(accountScreenSelector(route)); + + return account ? : null +} + +function ReceiveConfirmationInner({ navigation, route, account, parentAccount }: Props) { + const { colors } = useTheme(); const { t } = useTranslation(); const verified = route.params?.verified; const [isModalOpened, setIsModalOpened] = useState(true);