wallet-provider
wallet-provider copied to clipboard
Post transaction becomes unusable when user is inactive
Hello,
I have a generic hook used to post a transaction. It's fairly simple for now.
export const useTx = (opts: CreateTxOptions) => {
const connectedWallet = useConnectedWallet();
const wallet = useWallet();
const { fee } = useEstimateFee(opts);
const { mutateAsync: submit, ...rest } = useMutation(() => {
if (!connectedWallet) {
throw new Error("Wallet is not connected");
}
return wallet.post(opts)
});
return {
submit,
canSubmit: !!fee,
...rest,
};
};
The problem is that, after X minutes (I am still not sure if X is fixed or not) being inactive on the page. Then wallet.post
becomes unusable. The promise is neither fulfilled neither rejected. Nothing happen, the Terra Station popup does not show up.
I then need to refresh the page to be able to post a transaction.
I thought it was coming from my code (it's always the most likely) but I dig into the problem, and I am more and more convinced that the problem comes from this specific function wallet.post
I have worked on Astroport and I am currently working on Prism, I haven't been able to figure out what's the root cause so I willing to jump on a call with a maintainer, make myself available as much as possible to solve it, if we find out about the problem, I am also willing to contribute to fix this bug.
Hi @soueuls ,
We are having the same issues with wallet.post
. We have been trying to pinpoint the error but it seems it is too random.
Are you using any other wallet extension like Keplr along with Terra station?
I have exact same issue. Any solution for this except refreshing?
I haven't been able to fix this yet. Anyone else suffering from this? Did you find a solution?
This is still happening in version 3.8.1