From b9968c67f58d3c403081049a39ba4dade903a17d Mon Sep 17 00:00:00 2001 From: hz002 Date: Mon, 2 Dec 2024 18:16:46 +0800 Subject: [PATCH] fix: await swtich account --- .../TokenDetailPopup/BottomSheetModalTokenDetail.tsx | 4 ++-- apps/mobile/src/screens/Home/MultiAddressHome.tsx | 2 +- apps/mobile/src/screens/Home/components/HomeTopArea.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/mobile/src/components/TokenDetailPopup/BottomSheetModalTokenDetail.tsx b/apps/mobile/src/components/TokenDetailPopup/BottomSheetModalTokenDetail.tsx index 01a5d1f0d..9a3993a66 100644 --- a/apps/mobile/src/components/TokenDetailPopup/BottomSheetModalTokenDetail.tsx +++ b/apps/mobile/src/components/TokenDetailPopup/BottomSheetModalTokenDetail.tsx @@ -761,7 +761,7 @@ export const BottomSheetModalTokenDetail = React.forwardRef< ); const onRedirecTo = useCallback( - (type?: RedirectToType) => { + async (type?: RedirectToType) => { onTriggerDismissFromInternal?.({ reason: 'redirect-to', data: type }); const chainItem = !token?.chain ? null @@ -796,7 +796,7 @@ export const BottomSheetModalTokenDetail = React.forwardRef< break; } case 'Receive': { - switchSceneCurrentAccount( + await switchSceneCurrentAccount( 'MakeTransactionAbout', nextTxRedirectAccount || null, ); diff --git a/apps/mobile/src/screens/Home/MultiAddressHome.tsx b/apps/mobile/src/screens/Home/MultiAddressHome.tsx index ea025c29e..208f59eb2 100644 --- a/apps/mobile/src/screens/Home/MultiAddressHome.tsx +++ b/apps/mobile/src/screens/Home/MultiAddressHome.tsx @@ -301,7 +301,7 @@ function MultiAddressHome(): JSX.Element { modalTitle: 'Select Receive Address', onDone: async selectedAccount => { removeGlobalBottomSheetModal2024(selectAddressModalId); - switchSceneCurrentAccount('Receive', selectedAccount); + await switchSceneCurrentAccount('Receive', selectedAccount); const id = createGlobalBottomSheetModal2024({ name: MODAL_NAMES.SELECT_SORTED_CHAIN, value: CHAINS_ENUM.ETH, diff --git a/apps/mobile/src/screens/Home/components/HomeTopArea.tsx b/apps/mobile/src/screens/Home/components/HomeTopArea.tsx index 1fb2d513f..c68fc5569 100644 --- a/apps/mobile/src/screens/Home/components/HomeTopArea.tsx +++ b/apps/mobile/src/screens/Home/components/HomeTopArea.tsx @@ -220,7 +220,7 @@ export const HomeTopArea = () => { title: 'Receive', Icon: RcIconReceive, onPress: async () => { - switchSceneCurrentAccount('Receive', currentAccount); + await switchSceneCurrentAccount('Receive', currentAccount); const id = createGlobalBottomSheetModal2024({ name: MODAL_NAMES.SELECT_SORTED_CHAIN, value: CHAINS_ENUM.ETH,