Skip to content

Commit

Permalink
Fixed an issue about connecting wallets (#422)
Browse files Browse the repository at this point in the history
Closes # #381


### What

There is a issue related to incorrect handling of the Taho wallet in the
`@web3-onboard/taho` library. Let's fix this with a patch file. The
solution is still not ideal because it does not catch the change of
which wallet is switched on. This means that when we install the Taho
wallet we have to refresh the page to see that the wallet has been
installed. I think this solution is enough at the moment. Let's solve
this problem in #423.


### Testing

**When MetaMask is installed**

- [ ]  Try connecting when the wallet is the default
- [ ]  Try connecting when the wallet is not the default

**When MetaMask is'n installed**

- [ ] Try connecting when the wallet is the default
- [ ] Try connecting when the wallet is not the default

**When Taho isn't installed but MetaMask it is**

- [ ] There is no connection possible. The user receives the correct
message.
  • Loading branch information
ioay authored Oct 19, 2023
2 parents bd8f9a6 + ffa8023 commit 312a6f4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions patches/@web3-onboard+taho+2.0.5.patch
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
diff --git a/node_modules/@web3-onboard/taho/dist/index.js b/node_modules/@web3-onboard/taho/dist/index.js
index e2e3b4b..c3f648c 100644
index e2e3b4b..3706a5c 100644
--- a/node_modules/@web3-onboard/taho/dist/index.js
+++ b/node_modules/@web3-onboard/taho/dist/index.js
@@ -13,7 +13,9 @@ function tahoWallet() {
@@ -13,8 +13,11 @@ function tahoWallet() {
},
getIcon: async () => (await import('./icon.js')).default,
getInterface: async () => {
- const provider = await detectEthereumProvider({ mustBeTallyHo: true });
- if (!provider) {
+ // When Taho isn't the default wallet and MetaMask is installed we are unable to connect to the dapp.
+ // Let's force a connection to the Taho wallet.
+ // Let's force a connection to the Taho wallet and
+ // make sure the user receives the correct message when Taho isn't installed.
+ const provider = await detectEthereumProvider();
if (!provider) {
+ if (!provider || window.tally === undefined) {
const onboarding = new TallyHoOnboarding();
onboarding.startOnboarding();
throw new Error('Please install Taho to use this wallet');

0 comments on commit 312a6f4

Please sign in to comment.