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

View File

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