Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabethengelman committed Sep 3, 2024
1 parent 9fe349c commit 4a0b479
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/components/NetworkByPasswordProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export const NetworkByPasswordProvider = ({
}: {
children: React.ReactNode;
}) => {
const { updateIsDynamicNetworkSelect, transaction, selectNetwork } = useStore();
const { updateIsDynamicNetworkSelect, transaction, selectNetwork } =
useStore();

const searchParams = useSearchParams();

Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/components/NetworkSelector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4a0b479

Please sign in to comment.