From 2bcb769d1b7c2d6293b6cbb5a524e335a28baf7a Mon Sep 17 00:00:00 2001 From: druid3122 Date: Mon, 17 Jul 2023 20:55:11 +0800 Subject: [PATCH] fix check login bug --- package.json | 2 +- src/components/Header/Header.tsx | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 7ca37f9..71985c7 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "@emotion/styled": "^11.10.4", "@hcaptcha/react-hcaptcha": "^1.4.4", "@mui/material": "^5.10.7", - "@nulink_network/nulink-web-agent-access-sdk": "^0.1.8", + "@nulink_network/nulink-web-agent-access-sdk": "^0.2.0", "@testing-library/jest-dom": "^5.14.1", "@testing-library/react": "^12.0.0", "@testing-library/user-event": "^13.2.1", diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index 86b36d4..7410cc8 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -64,13 +64,13 @@ export const Header = ({ setLoginUser, setLoginStatus }) => { const _changeNetwork = async () => { if (selectNetworkConfig && selectNetworkConfig.key) { setShowConfirmTipModal(false); - localStorage.setItem( + /*localStorage.setItem( "nulink_agent_react_chain_id", selectNetworkConfig.value, ); + window.location.reload()*/ + await setNetWorkChainId(selectNetworkConfig.value); window.location.reload() - // await setNetWorkChainId(selectNetworkConfig.value); - // await _fetchData(); } }; @@ -125,8 +125,8 @@ export const Header = ({ setLoginUser, setLoginStatus }) => { }; const _fetchData = async () => { - // setChainID(await getNetWorkChainId()); - setChainID(Number(localStorage.getItem("nulink_agent_react_chain_id"))); + setChainID(await getNetWorkChainId()); + //setChainID(Number(localStorage.getItem("nulink_agent_react_chain_id"))); }; useEffect(() => {