From 327ad9d7e47a73113791b76b29eebeeb269b2584 Mon Sep 17 00:00:00 2001 From: apoorvlathey Date: Wed, 30 Oct 2024 16:15:50 +0400 Subject: [PATCH] fix tenderly initial value from local storage --- components/Body/index.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/Body/index.tsx b/components/Body/index.tsx index e09c0cb..21ef609 100644 --- a/components/Body/index.tsx +++ b/components/Body/index.tsx @@ -128,7 +128,10 @@ function Body() { ); const [iframeKey, setIframeKey] = useState(0); // hacky way to reload iframe when key changes - const [tenderlyForkId, setTenderlyForkId] = useState(""); + const storedTenderlyForkId = localStorage.getItem("tenderlyForkId"); + const [tenderlyForkId, setTenderlyForkId] = useState( + storedTenderlyForkId ?? "" + ); const [sendTxnData, setSendTxnData] = useState([]); useEffect(() => { @@ -145,9 +148,6 @@ function Body() { `https://mainnet.infura.io/v3/${process.env.NEXT_PUBLIC_INFURA_KEY}` ) ); - - const storedTenderlyForkId = localStorage.getItem("tenderlyForkId"); - setTenderlyForkId(storedTenderlyForkId ? storedTenderlyForkId : ""); }, []); useEffect(() => { @@ -518,7 +518,7 @@ function Body() { } toast({ - title: "Txn successful", + title: "Txn Simulated on Tenderly", description: `Hash: ${res.result}`, status: "success", position: "bottom-right",