Fix disconnect button behavior

This commit is contained in:
enzoggqs 2022-12-15 00:07:08 -03:00
parent 1af0cf3df7
commit 5cbcda47ec
2 changed files with 5 additions and 16 deletions

View File

@ -3,14 +3,13 @@ import { storeToRefs } from "pinia";
import { useEtherStore } from "../store/ether";
import { ref } from "vue";
import blockchain from "../utils/blockchain";
import router from "@/router";
// Store reference
const etherStore = useEtherStore();
const { walletAddress, balance } = storeToRefs(etherStore);
const emit = defineEmits(["disconnectUser"]);
const menuToggle = ref<boolean>(false);
//Methods
@ -35,12 +34,9 @@ const formatWalletBalance = (): string => {
return fixed;
};
// const disconnectWallet = () => {
// menuToggle.value = false;
// };
const log = () => {
console.log(menuToggle.value);
const disconnectUser = () => {
etherStore.setWalletAddress("");
router.push("/");
};
</script>
@ -117,7 +113,7 @@ const log = () => {
</div>
<div
class="menu-button px-4 py-1 rounded-md cursor-pointer"
@click="emit('disconnectUser', {})"
@click="disconnectUser"
>
<div class="py-3 text-end font-semibold text-xs">
Desconectar

View File

@ -62,12 +62,6 @@ const confirmBuyClick = async ({ selectedDeposit, tokenValue }: any) => {
// Valor = tokenValue
}
};
const disconnectUser = ({}: any) => {
console.log('entrou')
etherStore.setWalletAddress("");
flowStep.value == Step.Search;
};
</script>
<template>
@ -83,7 +77,6 @@ const disconnectUser = ({}: any) => {
/>
<ValidationComponent v-if="loadingLock" />
</div>
<div @disconnect-user="disconnectUser"></div>
</template>
<style scoped></style>