From 940d59fc0066156a3c80f5478c625936d8ce58ca Mon Sep 17 00:00:00 2001 From: Ben Kremer Date: Fri, 4 Feb 2022 11:34:24 +0100 Subject: [PATCH] fix(react-dapp): ensures pending state is set before RPC modal opens --- dapps/react-dapp-v2/src/HooksApp.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dapps/react-dapp-v2/src/HooksApp.tsx b/dapps/react-dapp-v2/src/HooksApp.tsx index d1cb012..237306e 100644 --- a/dapps/react-dapp-v2/src/HooksApp.tsx +++ b/dapps/react-dapp-v2/src/HooksApp.tsx @@ -388,6 +388,7 @@ export default function App() { } try { + setPending(true); // get ethereum address const account = accounts.find(account => account.startsWith(chainId)); if (account === undefined) throw new Error("Account is not found"); @@ -447,6 +448,7 @@ export default function App() { } try { + setPending(true); // test message const message = `My email is john@doe.com - ${Date.now()}`; @@ -516,6 +518,8 @@ export default function App() { throw new Error("Session is not connected"); } try { + setPending(true); + // test message const message = JSON.stringify(eip712.example);