mirror of
https://github.com/Instadapp/assembly.git
synced 2024-07-29 22:37:06 +00:00
disable btns on connecting
This commit is contained in:
parent
73afb91ba9
commit
0661410adf
|
@ -23,6 +23,7 @@
|
|||
<button
|
||||
class="w-full px-6 py-3 text-left flex items-center h-[80px] border border-[#DBE5F4] rounded-[4px] text-lg text-[#374253] font-semibold hover:bg-background-light"
|
||||
v-for="(wallet, key) in wallets"
|
||||
:disabled="connecting"
|
||||
:key="key"
|
||||
@click="connect(wallet.connector)"
|
||||
>
|
||||
|
@ -91,12 +92,16 @@ export default defineComponent({
|
|||
const { activate } = useWeb3()
|
||||
const { activeNetworkId } = useNetwork()
|
||||
const { showError, showAwaiting, closeAll } = useNotification()
|
||||
const connecting = ref(false)
|
||||
|
||||
const connect = async (connector) => {
|
||||
connecting.value = true
|
||||
|
||||
showAwaiting("Connecting...")
|
||||
|
||||
try {
|
||||
await activate(connector, undefined, true)
|
||||
connecting.value = false
|
||||
close()
|
||||
closeAll()
|
||||
} catch (error) {
|
||||
|
@ -104,6 +109,8 @@ export default defineComponent({
|
|||
showError("", error.message)
|
||||
}
|
||||
|
||||
connecting.value = false
|
||||
|
||||
}
|
||||
const isMetamask = computed(() => process.server ? false : window.ethereum && window.ethereum.isMetaMask)
|
||||
|
||||
|
@ -127,6 +134,7 @@ export default defineComponent({
|
|||
wallets,
|
||||
isMetamask,
|
||||
injected,
|
||||
connecting,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue
Block a user