Skip to content

Commit

Permalink
fix: network not being set by hostname (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
JackHamer09 authored Jul 4, 2023
1 parent b1f4944 commit 7944e98
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion store/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ export const useNetworkStore = defineStore("network", () => {
const networkFromQueryParam = new URLSearchParams(windowLocation.search).get("network");
const networkOnDomain = chains.find((e) => e.hostnames.includes(windowLocation.origin));
const defaultNetwork = chains[0];
const defaultNetworkName = defaultNetwork.network;
if (networkFromQueryParam && chains.some((e) => e.network === networkFromQueryParam)) {
selectedEthereumNetworkName.value = networkFromQueryParam as EthereumNetworkName;
} else if (selectedEthereumNetworkName.value === defaultNetwork.name) {
} else if (selectedEthereumNetworkName.value === defaultNetworkName) {
if (networkOnDomain) {
selectedEthereumNetworkName.value = networkOnDomain.network;
} else {
Expand Down

0 comments on commit 7944e98

Please sign in to comment.