From 17c817bcec42112b17b980ec5ede231fe670b19f 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 | 8 +++----- 2 files changed, 9 insertions(+), 9 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..a584dde9 100644 --- a/src/components/NetworkSelector/index.tsx +++ b/src/components/NetworkSelector/index.tsx @@ -1,4 +1,3 @@ -import { Button, Icon, Input, Notification } from "@stellar/design-system"; import React, { useCallback, useEffect, @@ -6,11 +5,12 @@ import React, { useRef, useState, } from "react"; +import { Button, Icon, Input, Notification } from "@stellar/design-system"; import { NetworkIndicator } from "@/components/NetworkIndicator"; -import { NetworkOptions } from "@/constants/settings"; -import { delayedAction } from "@/helpers/delayedAction"; import { localStorageSavedNetwork } from "@/helpers/localStorageSavedNetwork"; +import { delayedAction } from "@/helpers/delayedAction"; +import { NetworkOptions } from "@/constants/settings"; import { useStore } from "@/store/useStore"; import { Network, NetworkType } from "@/types/types"; @@ -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);