How can I send a message when the user has clicked on approve on the popup?

Hey I simply wanna send a message when the user has clikced on approve transaction.
Sadly i can only wait till the request beeing done completele ?
Im looking for like a .on(“asigned”) etc…

                    contractInstance.methods.approve(receiver, transaction.price.toString())
                        from: this.walletAddress,
                     }).then(txHash => { .....

Can you not just send the message as soon as the user clicks the button or “Approve” from onclick? I.e. independently of web3.js.


// web3.js code

No because he can deny it.

I am looking for like a

I mean the popup when you make a transaction. The metamask popup.

When there is a money trasnaction for example and the user asigns the trasnaction on the metamask popup. I then want to send a console.log for example that says trasnaction approved

You can follow this: web3.eth.Contract — web3.js 1.0.0 documentation

E.g. console.log in confirmation so it says transaction approved after the transaction has been confirmed.