From 0ffb2b4d3c1eeaa941c661e4d6c30b0dade51ed4 Mon Sep 17 00:00:00 2001 From: abefernan <44572727+abefernan@users.noreply.github.com> Date: Mon, 17 Apr 2023 16:59:42 +0200 Subject: [PATCH] Consistent try and setLoading --- components/forms/TransactionSigning.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/forms/TransactionSigning.tsx b/components/forms/TransactionSigning.tsx index 62d7bfc..2151b70 100644 --- a/components/forms/TransactionSigning.tsx +++ b/components/forms/TransactionSigning.tsx @@ -36,9 +36,9 @@ const TransactionSigning = (props: Props) => { const connectKeplr = async () => { try { + setLoading((newLoading) => ({ ...newLoading, keplr: true })); assert(state.chain.chainId, "chainId missing"); - setLoading((newLoading) => ({ ...newLoading, keplr: true })); await window.keplr.enable(state.chain.chainId); window.keplr.defaultOptions = { sign: { preferNoSetFee: true, preferNoSetMemo: true, disableBalanceCheck: true }, @@ -60,9 +60,9 @@ const TransactionSigning = (props: Props) => { const connectLedger = async () => { try { + setLoading((newLoading) => ({ ...newLoading, ledger: true })); assert(state.chain.addressPrefix, "addressPrefix missing"); - setLoading((newLoading) => ({ ...newLoading, ledger: true })); // Prepare ledger const ledgerTransport = await TransportWebUSB.create(120000, 120000); @@ -95,10 +95,10 @@ const TransactionSigning = (props: Props) => { }; const signTransaction = async () => { - assert(state.chain.chainId, "chainId missing"); - try { setLoading((newLoading) => ({ ...newLoading, signing: true })); + assert(state.chain.chainId, "chainId missing"); + const offlineSigner = walletType === "Keplr" ? window.getOfflineSignerOnlyAmino(state.chain.chainId)