From 2a15bc0e79f72f9ef5ae2bdc82ffb710d58fb096 Mon Sep 17 00:00:00 2001 From: hieu-w Date: Thu, 22 Aug 2024 10:35:36 +0700 Subject: [PATCH] Resolve conflict --- demo/vue-app-new/src/MainView.vue | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/demo/vue-app-new/src/MainView.vue b/demo/vue-app-new/src/MainView.vue index 311f9d865..e1d7cec2e 100644 --- a/demo/vue-app-new/src/MainView.vue +++ b/demo/vue-app-new/src/MainView.vue @@ -9,7 +9,6 @@ import { useWeb3Auth } from "@web3auth/modal-vue-composables"; import { OpenloginAdapter } from "@web3auth/openlogin-adapter"; import { PhantomAdapter } from "@web3auth/phantom-adapter"; import { SolanaPrivateKeyProvider } from "@web3auth/solana-provider"; -import { SolanaWalletConnectorPlugin } from "@web3auth/solana-wallet-connector-plugin"; import { TorusWalletAdapter } from "@web3auth/torus-evm-adapter"; import { SolanaWalletAdapter } from "@web3auth/torus-solana-adapter"; import { WalletServicesPlugin } from "@web3auth/wallet-services-plugin"; @@ -46,7 +45,6 @@ const formData = ref({ }, loginProviders: [], adapters: [], - enableWalletServicePlugin: false, loginMethods: defaultLoginMethod, walletPlugin: { enable: false, @@ -172,6 +170,10 @@ const getExternalAdapterByName = (name: string) => { } }; +const isWalletPluginEnabled = () => { + return formData.value.chainNamespace == CHAIN_NAMESPACES.EIP155 && formData.value.walletPlugin.enable; +}; + const initW3A = async () => { if (!chainOptions.value.find((option) => option.value === formData.value.chain)) formData.value.chain = chainOptions.value[0]?.value; if (storageAvailable("sessionStorage")) sessionStorage.setItem("state", JSON.stringify(formData.value)); @@ -181,7 +183,7 @@ const initW3A = async () => { const externalAdapter = getExternalAdapterByName(formData.value.adapters[i]); if (externalAdapter) web3Auth.value.configureAdapter(externalAdapter); } - if (formData.value.walletPlugin.enable) await addPlugin(walletPlugin.value); + if (isWalletPluginEnabled()) await addPlugin(walletPlugin.value); await initModal(modalParams.value); }; @@ -315,7 +317,7 @@ const isDisplay = (name: string): boolean => { return formData.value.chainNamespace === CHAIN_NAMESPACES.SOLANA; case "walletServices": - return formData.value.walletPlugin.enable; + return isWalletPluginEnabled(); default: { return false; @@ -613,6 +615,7 @@ const showWalletConnectScanner = async () => { { class="mb-2" />