From 4a0b479855c918d92044dab3f1382a0d71471687 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 ++++++---- src/components/NetworkSelector/index.tsx | 2 -- 2 files changed, 6 insertions(+), 6 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); diff --git a/src/components/NetworkSelector/index.tsx b/src/components/NetworkSelector/index.tsx index 4bfd1df5..c7e558bd 100644 --- a/src/components/NetworkSelector/index.tsx +++ b/src/components/NetworkSelector/index.tsx @@ -94,11 +94,9 @@ export const NetworkSelector = () => { const isMainnetNetwork = activeNetworkId === "mainnet"; const setNetwork = useCallback(() => { - console.log("here in setNetwork. there is no network.id?", network?.id); if (!network?.id) { const defaultNetwork = localStorageSavedNetwork.get() || getNetworkById("testnet"); - console.log("using the default: ", defaultNetwork); if (defaultNetwork) { selectNetwork(defaultNetwork);