I have tried diff ways to get confirmation state in order to update Front-end UI,
- useWeb3Contract (there is no state in this hooks)
- use Moralis Database written data through contract emit an event. it worked. but it still no state.
I can see the a new record was added to database each time. but I can’t get the real data from blockchain after refresh my website. until metamask popups up a confirmation. then refresh page again. it worked…
useMoralisSubscription(
"RecordTable", q => q, [], {
onCreate: data => {
console.log(data.attributes)
// 🤔log is printed always before metamask popups up
getRecordList()
}
}
)
How to solve it?