Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stuck on loading after adding product or buying. #6

Open
maxfinnsjo opened this issue Mar 31, 2020 · 8 comments
Open

Stuck on loading after adding product or buying. #6

maxfinnsjo opened this issue Mar 31, 2020 · 8 comments

Comments

@maxfinnsjo
Copy link

After adding product page is just loading. After refreshing I can see the newly added product.

Same on buying product, after purchase complete stuck on loading, when refreshing new owner address has been updated.

@kuabhish
Copy link

kuabhish commented Apr 3, 2020

It happens because receipt is not firing. It has some issue. You can change the receipt to transactionhash because it is one of the properties of send function. then this works.

@hartej-s
Copy link

hartej-s commented Apr 7, 2020

hi im having the same issue, ive changed:

createProduct(name, price) {
this.setState({ loading: true })
this.state.marketplace.methods.createProduct(name, price).send({ from: this.state.account })
.once('receipt', (receipt) => {
this.setState({ loading: false })
})
}

to:

createProduct(name, price) {
this.setState({ loading: true })
this.state.marketplace.methods.createProduct(name, price).send({ from: this.state.account })
.once('transactionHash', (transactionHash) => {
this.setState({ loading: false })
})
}

and it still does not work, am I doing something wrong

@kuabhish
Copy link

kuabhish commented Apr 7, 2020

https://web3js.readthedocs.io/en/v1.2.6/web3-eth-contract.html#id36

check this

you can also use confirmation.

@hartej-s
Copy link

hartej-s commented Apr 7, 2020

createProduct(name, price) {
this.setState({ loading: true })
this.state.marketplace.methods.createProduct(name, price).send({ from: this.state.account })
.on('transactionHash', (hash) => {
this.setState({ loading: false })
})
}

this still does not work.

@kuabhish
Copy link

kuabhish commented Apr 7, 2020

Use confirmation.

@hartej-s
Copy link

hartej-s commented Apr 7, 2020

createProduct(station, duration, price) {
this.setState({ loading: true })
this.state.marketplace.methods.createProduct(station, duration, price).send({ from: this.state.account })
.on('confirmation', (confirmationNumber, receipt) => {
this.setState({ loading: false })
})
}

still does not work

@kuabhish
Copy link

kuabhish commented Apr 7, 2020

web3/web3.js#2104 -- check this once

@kuabhish
Copy link

kuabhish commented Apr 9, 2020

@hartej-s anything worked?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants