mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-01-19 05:45:15 +01:00
Update screen/transactions/TransactionStatus.tsx
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
parent
6847802d40
commit
a6d8975f66
@ -539,15 +539,19 @@ const TransactionStatus: React.FC<TransactionStatusProps> = ({ transaction, txid
|
||||
|
||||
useEffect(() => {
|
||||
if (isLoading) {
|
||||
let isComponentMounted = true;
|
||||
const loadingTimeout = setTimeout(() => {
|
||||
if (isLoading) {
|
||||
if (isComponentMounted && isLoading) {
|
||||
dispatch({ type: ActionType.SetLoadingError, payload: true });
|
||||
dispatch({ type: ActionType.SetLoading, payload: false });
|
||||
console.error('Loading timed out. There was an issue fetching the transaction.');
|
||||
}
|
||||
}, 10000);
|
||||
|
||||
return () => clearTimeout(loadingTimeout);
|
||||
return () => {
|
||||
isComponentMounted = false;
|
||||
clearTimeout(loadingTimeout);
|
||||
};
|
||||
}
|
||||
}, [isLoading]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user