diff --git a/components/forms/CreateTxForm/index.tsx b/components/forms/CreateTxForm/index.tsx index e861838..c1e7caa 100644 --- a/components/forms/CreateTxForm/index.tsx +++ b/components/forms/CreateTxForm/index.tsx @@ -32,6 +32,7 @@ const CreateTxForm = ({ router, senderAddress, accountOnChain }: CreateTxFormPro const [memo, setMemo] = useState(""); const [gasLimit, setGasLimit] = useState(gasOfTx([])); const [gasLimitError, setGasLimitError] = useState(""); + const [showCreateTxError, setShowTxError] = useState(false); const gasPrice = state.chain.gasPrice; assert(gasPrice, "gasPrice missing"); @@ -47,6 +48,8 @@ const CreateTxForm = ({ router, senderAddress, accountOnChain }: CreateTxFormPro const createTx = async () => { try { + setShowTxError(false); + assert(typeof accountOnChain.accountNumber === "number", "accountNumber missing"); assert(msgGetters.current.length, "form filled incorrectly"); @@ -81,6 +84,7 @@ const CreateTxForm = ({ router, senderAddress, accountOnChain }: CreateTxFormPro router.push(`${senderAddress}/transaction/${transactionID}`); } catch (error) { console.error("Creat transaction error:", error); + setShowTxError(true); } finally { setProcessing(false); } @@ -158,6 +162,13 @@ const CreateTxForm = ({ router, senderAddress, accountOnChain }: CreateTxFormPro />