Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Commit

Permalink
- add logic to AccountHeaderActions to determine if dev mode is enabled
Browse files Browse the repository at this point in the history
- if enabled, allow for goerli test net to exist for WalletConnect local testing.
  • Loading branch information
bberz-groma committed May 23, 2022
1 parent 1d050e2 commit 2584248
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/renderer/screens/account/AccountHeaderActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {
SendActionDefault,
SwapActionDefault,
} from "./AccountActionsDefault";
import useEnv from "~/renderer/hooks/useEnv";

const ButtonSettings: ThemedComponent<{ disabled?: boolean }> = styled(Tabbable).attrs(() => ({
alignItems: "center",
Expand Down Expand Up @@ -87,6 +88,10 @@ type Props = {
const AccountHeaderSettingsButtonComponent = ({ account, parentAccount, openModal, t }: Props) => {
const currency = getAccountCurrency(account);

const devModeEnabled = useEnv("MANAGER_DEV_MODE");
const walletConnectBaseNetorks = ["ethereum", "bsc", "polygon"];
const walletConnectNetworks = devModeEnabled ? [...walletConnectBaseNetorks, "ethereum_ropsten", "ethereum_goerli"] : walletConnectBaseNetorks;

const onWalletConnect = useCallback(() => {
setTrackingSource("account header actions");
openModal("MODAL_WALLETCONNECT_PASTE_LINK", { account });
Expand All @@ -102,7 +107,7 @@ const AccountHeaderSettingsButtonComponent = ({ account, parentAccount, openModa
rounded
/>
</Tooltip>
{["ethereum", "bsc", "polygon"].includes(currency.id) ? (
{walletConnectNetworks.includes(currency.id) ? (
<Tooltip content={t("walletconnect.titleAccount")}>
<ButtonSettings onClick={onWalletConnect}>
<Box justifyContent="center">
Expand Down

0 comments on commit 2584248

Please sign in to comment.