From f9dd1f17384947a3ac10d480f71a995e2122401c Mon Sep 17 00:00:00 2001 From: Harsh R <53080940+fullstackninja864@users.noreply.github.com> Date: Wed, 3 Jan 2024 09:16:08 +0530 Subject: [PATCH] fix(ui-ux): fixed address book forgets saved addresses when user switch to custom provider (#4156) --- .../screens/Settings/screens/ServiceProviderScreen.tsx | 7 ++++++- shared/contexts/WalletDataProvider.tsx | 10 +++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/mobile-app/app/screens/AppNavigator/screens/Settings/screens/ServiceProviderScreen.tsx b/mobile-app/app/screens/AppNavigator/screens/Settings/screens/ServiceProviderScreen.tsx index 6fe6cc80d4..e12fb10b81 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Settings/screens/ServiceProviderScreen.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Settings/screens/ServiceProviderScreen.tsx @@ -192,7 +192,12 @@ export function ServiceProviderScreen({ navigation }: Props): JSX.Element { ))} {showActionButtons && ( - + 1, + })} + > + props: PropsWithChildren, ): JSX.Element | null { const blockCount = useSelector((state: RootState) => state.block.count); const client = useWhaleApiClient(); @@ -36,7 +36,7 @@ export function WalletDataProvider( fetchDexPrice({ client, denomination: "USDT", - }) + }), ); }); }, [blockCount, network]); @@ -47,7 +47,7 @@ export function WalletDataProvider( if (isFeatureAvailable("local_storage")) { dispatch(fetchUserPreferences(network)); } - }, [network, wallets]); + }, [network, wallets, isFeatureAvailable]); /* Global polling based on blockCount, network and address */ useEffect(() => { @@ -56,13 +56,13 @@ export function WalletDataProvider( fetchTokens({ client, address, - }) + }), ); dispatch( fetchVaults({ client, address, - }) + }), ); }); }, [blockCount, network, address]);