From 44b2cac9f3f144b05798adc208e86f5f827ca609 Mon Sep 17 00:00:00 2001 From: Ben Kremer Date: Tue, 1 Mar 2022 14:13:14 +0000 Subject: [PATCH] fix(v2-cosmos-provider): set RPC result on caught error --- dapps/react-dapp-v2-cosmos-provider/src/App.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dapps/react-dapp-v2-cosmos-provider/src/App.tsx b/dapps/react-dapp-v2-cosmos-provider/src/App.tsx index fee02e1..a52f294 100644 --- a/dapps/react-dapp-v2-cosmos-provider/src/App.tsx +++ b/dapps/react-dapp-v2-cosmos-provider/src/App.tsx @@ -22,9 +22,9 @@ import { import { useWalletConnectClient } from "./contexts/ClientContext"; interface IFormattedRpcResponse { - method: string; - address: string; - valid: boolean; + method?: string; + address?: string; + valid?: boolean; result: string; } @@ -179,6 +179,7 @@ export default function App() { setRpcResult(result); } catch (error) { console.error("RPC request failed:", error); + setRpcResult({ result: error as string }); } finally { setIsRpcRequestPending(false); }