diff --git a/src/components/TopBar.vue b/src/components/TopBar.vue index eb34159..6c5aa38 100644 --- a/src/components/TopBar.vue +++ b/src/components/TopBar.vue @@ -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(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("/"); }; @@ -117,7 +113,7 @@ const log = () => {