From 00a8833fbefae7dcae2ea8cfa22b73efda96c101 Mon Sep 17 00:00:00 2001 From: Elizabeth Engelman <4752801+elizabethengelman@users.noreply.github.com> Date: Fri, 30 Aug 2024 09:59:03 -0400 Subject: [PATCH] Cleanup --- src/components/NetworkByPasswordProvider.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/NetworkByPasswordProvider.tsx b/src/components/NetworkByPasswordProvider.tsx index f2b8ef8b..443f9553 100644 --- a/src/components/NetworkByPasswordProvider.tsx +++ b/src/components/NetworkByPasswordProvider.tsx @@ -11,7 +11,8 @@ export const NetworkByPasswordProvider = ({ }: { children: React.ReactNode; }) => { - const { updateIsDynamicNetworkSelect, transaction, selectNetwork } = useStore(); + const { updateIsDynamicNetworkSelect, transaction, selectNetwork } = + useStore(); const searchParams = useSearchParams(); @@ -20,16 +21,17 @@ export const NetworkByPasswordProvider = ({ }; useEffect(() => { - let networkPassphrase = searchParams.get("networkPassphrase"); + const networkPassphrase = searchParams.get("networkPassphrase"); + const xdr = searchParams.get("xdr"); + if (networkPassphrase) { - let network = getNetworkByPassphrase(networkPassphrase); + const network = getNetworkByPassphrase(networkPassphrase); if (network) { updateIsDynamicNetworkSelect(true); selectNetwork(network); } } - let xdr = searchParams.get("xdr"); if (xdr) { transaction.updateSignActiveView("overview"); transaction.updateSignImportXdr(xdr);