From 184542b7b1978b9d4b3f0d80d70a05805f868fc9 Mon Sep 17 00:00:00 2001 From: jdrskr Date: Tue, 5 Dec 2023 09:59:13 +0100 Subject: [PATCH] fix: login redirect. --- .../src/pages/account/pages/LoginPage.tsx | 2 +- .../pages/components/InteractionsWidget.tsx | 20 ++----------------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/frontend/src/pages/account/pages/LoginPage.tsx b/frontend/src/pages/account/pages/LoginPage.tsx index d16a40a..d59769c 100644 --- a/frontend/src/pages/account/pages/LoginPage.tsx +++ b/frontend/src/pages/account/pages/LoginPage.tsx @@ -47,7 +47,7 @@ export const LoginPage: React.FC = () => { if (auth.isAdmin) { navigate("/admin/orders"); } else { - navigate("/client/issue"); + navigate("/client/placeOrder"); } snackbar.enqueueSnackbar("Login success", { diff --git a/frontend/src/pages/client/pages/components/InteractionsWidget.tsx b/frontend/src/pages/client/pages/components/InteractionsWidget.tsx index bc9ce80..73adb88 100644 --- a/frontend/src/pages/client/pages/components/InteractionsWidget.tsx +++ b/frontend/src/pages/client/pages/components/InteractionsWidget.tsx @@ -108,37 +108,21 @@ export const InteractionsWidget: React.FC = () => { variant: "success", }); } catch (e) { - setLoading(false); snackbar.enqueueSnackbar(`Order placement failed`, { variant: "error", }); + } finally { + setLoading(false); } } }; - const fetch = async () => { - if (contract) { - const address = await signer!.getAddress(); - - const x = await contract.userOrders(address, ASSETS.LFN.address!); - - console.log(x); - } - }; - React.useEffect(() => { if (web3Context) { setSigner({ signer: web3Context.signer, address: web3Context.account }); } }, [web3Context]); - React.useEffect(() => { - if (signer) { - fetch(); - } - // eslint-disable-next-line - }, [signer]); - return (