diff --git a/src/components/SellerSteps/WantSellComponent.vue b/src/components/SellerSteps/WantSellComponent.vue index 9b1ca63..4ac445c 100644 --- a/src/components/SellerSteps/WantSellComponent.vue +++ b/src/components/SellerSteps/WantSellComponent.vue @@ -3,8 +3,14 @@ import { ref } from "vue"; import CustomButton from "../CustomButton.vue"; import { debounce } from "@/utils/debounce"; import { decimalCount } from "@/utils/decimalCount"; +import { useEtherStore } from "@/store/ether"; +import { storeToRefs } from "pinia"; +import { connectProvider } from "@/blockchain/provider"; // Reactive state +const etherStore = useEtherStore(); +const { walletAddress } = storeToRefs(etherStore); + const offer = ref(""); const pixKey = ref(""); @@ -28,6 +34,11 @@ const handleInputEvent = (event: any): void => { } validDecimals.value = true; }; + +const handleButtonClick = async (): Promise => { + if (walletAddress.value) emit("approveTokens", { offer, pixKey }); + else await connectProvider(); +};