Protect paymentInfo (#2811)

This commit is contained in:
Jaco Greeff 2020-05-26 09:08:36 +02:00 committed by GitHub
parent feba08e668
commit 8e30a8620e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,9 +27,11 @@ function Checks ({ accountId, className = '', extrinsic }: Props): React.ReactEl
useEffect((): void => {
accountId && extrinsic && isFunction(api.rpc.payment?.queryInfo) &&
extrinsic
.paymentInfo(accountId)
.then(setDispatchInfo);
Promise.resolve(
extrinsic
.paymentInfo(accountId)
.then(setDispatchInfo)
).catch(console.error);
}, [api, accountId, extrinsic]);
if (!dispatchInfo) {