Skip to content

Commit

Permalink
fix: login redirect.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdrskr committed Dec 5, 2023
1 parent 70733dd commit 184542b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
2 changes: 1 addition & 1 deletion frontend/src/pages/account/pages/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand Down
20 changes: 2 additions & 18 deletions frontend/src/pages/client/pages/components/InteractionsWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Card sx={{ width: 350 }}>
<CardContent>
Expand Down

0 comments on commit 184542b

Please sign in to comment.