From 8ad36a7f4d6aa1734850b3d1fbf90245cf15dfac Mon Sep 17 00:00:00 2001 From: Karolina Kosiorowska Date: Wed, 18 Oct 2023 13:18:09 +0200 Subject: [PATCH] Create patch file for `@web3-onboard/taho` 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 and make sure the user receives the correct message when Taho isn't installed. --- patches/@web3-onboard+taho+2.0.5.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 patches/@web3-onboard+taho+2.0.5.patch diff --git a/patches/@web3-onboard+taho+2.0.5.patch b/patches/@web3-onboard+taho+2.0.5.patch new file mode 100644 index 000000000..8ad4328f9 --- /dev/null +++ b/patches/@web3-onboard+taho+2.0.5.patch @@ -0,0 +1,18 @@ +diff --git a/node_modules/@web3-onboard/taho/dist/index.js b/node_modules/@web3-onboard/taho/dist/index.js +index e2e3b4b..3706a5c 100644 +--- a/node_modules/@web3-onboard/taho/dist/index.js ++++ b/node_modules/@web3-onboard/taho/dist/index.js +@@ -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 and ++ // make sure the user receives the correct message when Taho isn't installed. ++ const provider = await detectEthereumProvider(); ++ if (!provider || window.tally === undefined) { + const onboarding = new TallyHoOnboarding(); + onboarding.startOnboarding(); + throw new Error('Please install Taho to use this wallet');