Merge branch 'creation_of_purchase_screens' of https://github.com/liftlearning/P2Pix-Front-End into creation_of_purchase_screens
This commit is contained in:
commit
f2b7617726
@ -12,10 +12,9 @@ import { ethers } from "ethers";
|
||||
import QrCodeForm from "../components/QrCodeForm.vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
|
||||
|
||||
enum Step {
|
||||
Search,
|
||||
Buy
|
||||
Buy,
|
||||
}
|
||||
|
||||
// States
|
||||
@ -29,7 +28,7 @@ const confirmBuyClick = async ({ selectedDeposit, tokenValue }: any) => {
|
||||
// finish buy screen
|
||||
console.log(selectedDeposit);
|
||||
let depositDetail;
|
||||
const depositId = selectedDeposit["args"]["depositID"]
|
||||
const depositId = selectedDeposit["args"]["depositID"];
|
||||
await blockchain
|
||||
.mapDeposits(depositId)
|
||||
.then((deposit) => (depositDetail = deposit));
|
||||
@ -40,16 +39,12 @@ const confirmBuyClick = async ({ selectedDeposit, tokenValue }: any) => {
|
||||
|
||||
// Makes lock with deposit ID and the Amount
|
||||
if (depositDetail) {
|
||||
flowStep.value = Step.Buy
|
||||
flowStep.value = Step.Buy;
|
||||
etherStore.setLoadingLock(true);
|
||||
const lock = await blockchain.addLock(
|
||||
depositId,
|
||||
tokenValue
|
||||
).catch((_error) => {
|
||||
flowStep.value = Step.Search
|
||||
})
|
||||
|
||||
console.log(lock);
|
||||
await blockchain.addLock(depositId, tokenValue).catch((_error) => {
|
||||
flowStep.value = Step.Search;
|
||||
});
|
||||
|
||||
// (TO DO) Tirar isso daqui
|
||||
const window_ = window as any;
|
||||
|
Loading…
x
Reference in New Issue
Block a user