diff --git a/packages/react-signer/src/TxSigned.tsx b/packages/react-signer/src/TxSigned.tsx index 1969a4e9df..ac0685ce0c 100644 --- a/packages/react-signer/src/TxSigned.tsx +++ b/packages/react-signer/src/TxSigned.tsx @@ -119,8 +119,10 @@ async function wrapTx (api: ApiPromise, currentItem: QueueTx, { isMultiCall, mul if (multiRoot) { const multiModule = api.tx.multisig ? 'multisig' : 'utility'; - const info = await api.query[multiModule].multisigs>(multiRoot, tx.method.hash); - const { weight } = await tx.paymentInfo(multiRoot); + const [info, { weight }] = await Promise.all([ + api.query[multiModule].multisigs>(multiRoot, tx.method.hash), + tx.paymentInfo(multiRoot) + ]); const { threshold, who } = extractExternal(multiRoot); const others = who.filter((w) => w !== signAddress); let timepoint: Timepoint | null = null; @@ -182,12 +184,12 @@ function TxSigned ({ className, currentItem, requestAddress }: Props): React.Rea const { queueSetTxStatus } = useContext(StatusContext); const [flags, setFlags] = useState(() => tryExtract(requestAddress)); const [error, setError] = useState(null); - const [{ isQrHashed, qrAddress, qrPayload, qrResolve }, setQrState] = useState({ isQrHashed: false, qrAddress: '', qrPayload: new Uint8Array() }); + const [{ isQrHashed, qrAddress, qrPayload, qrResolve }, setQrState] = useState(() => ({ isQrHashed: false, qrAddress: '', qrPayload: new Uint8Array() })); const [isBusy, setBusy] = useState(false); const [isRenderError, toggleRenderError] = useToggle(); const [isSubmit, setIsSubmit] = useState(true); const [passwordError, setPasswordError] = useState(null); - const [senderInfo, setSenderInfo] = useState({ isMultiCall: false, isUnlockCached: false, multiRoot: null, proxyRoot: null, signAddress: requestAddress, signPassword: '' }); + const [senderInfo, setSenderInfo] = useState(() => ({ isMultiCall: false, isUnlockCached: false, multiRoot: null, proxyRoot: null, signAddress: requestAddress, signPassword: '' })); const [signedOptions, setSignedOptions] = useState>({}); const [signedTx, setSignedTx] = useState(null); const [{ innerHash, innerTx }, setCallInfo] = useState(EMPTY_INNER);