Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Disable auto network switch/add user network switch #610

Merged
merged 7 commits into from
Jul 6, 2021

Conversation

ReflectiveChimp
Copy link

@ReflectiveChimp ReflectiveChimp commented Jul 4, 2021

Changes

  • Disables the automatic switch network prompt, resolving remove the switch network prompt on network change detected #411
  • Adds in-page notice (NetworkConnectNotice) showing user which network they need to switch to, or linking them to the appropriate app if we support the network, resolving Indicate which network to connect to #548
  • Removes NetworkError component
  • Removes PoolAccordion component: Only seemed to exist for an if (connected) check, which happens in the root App
  • Adds getNetworkAppUrl - to return url of app (e.g. fantom.beefy.finance)
  • getNetworkFriendlyName, getNetworkBuyUrl and getNetworkAppUrl can optionally be passed a network id; defaulting to process.env.REACT_APP_NETWORK_ID

Strings

Adds:

"Network-UnknownError": "An unknown error has occurred.",
"Network-ConnectionRequired": "Wallet connection to {{network}} required.",
"Network-Supports": "This app supports {{network}}.",
"Network-ConnectedTo": "You are currently connected to {{network}}.",
"Network-ConnectedUnsupported": "You are currently connected to an unsupported network.",
"Network-ConnectWallet": "Connect wallet",
"Network-DisconnectWallet": "Disconnect wallet",
"Network-SwitchToNetwork": "Switch to {{network}} network",
"Network-GoToApp": "Go to {{network}} app",
"Network-SwitchNote": "You may need to manually switch network via your wallet.",
"Network-NoWalletAddress": "Allow access to one account in your wallet.",

Removes:

"Network-Error": "Connect to {{network}} please.",

Note: Renamed Vault-ConnectWallet to Network-ConnectWallet where available.

Screenshots

No wallet connected:
light-not-connected

Connected to wrong, unsupported network (e.g. Ethereum):
light-unsupported-network

Connected to wrong, supported network (e.g. Fantom while on app.beefy.finance):
light-supported-network

Any errors returned from networkSetup are shown:
light-error

Dark mode desktop:
dark-desktop

Dark mode mobile:
dark-mobile

+ui for switching network/app
# Conflicts:
#	src/features/home/App.js
Rename `Vault-ConnectWallet` string to `Network-ConnectWallet`
Remove `Network-Error` string
@ReflectiveChimp
Copy link
Author

Special thanks to Chip for testing out various mobile wallets:
We found that some of them do not support automatic network switching via the 'Switch to {network} network' button (i.e. via wallet_addEthereumChain call).
Added a note regarding this so the user knows to switch manually.

image

@ReflectiveChimp ReflectiveChimp marked this pull request as ready for review July 5, 2021 16:40
@ReflectiveChimp
Copy link
Author

ReflectiveChimp commented Jul 5, 2021

If everyone is happy, this should be good to merge

@ReflectiveChimp ReflectiveChimp marked this pull request as draft July 5, 2021 16:45
@ReflectiveChimp ReflectiveChimp marked this pull request as ready for review July 5, 2021 16:48
@roman-monk roman-monk merged commit 629bf04 into beefyfinance:master Jul 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants