Skip to content

Commit

Permalink
Fix : MainPage isLogin state works well #78
Browse files Browse the repository at this point in the history
Signed-off-by: bentshrimp <[email protected]>
  • Loading branch information
bentshrimp committed Oct 5, 2023
1 parent 5862834 commit 9b52615
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pages/MainPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ async function checkTokenValid() {
function MainPage() {
const setIsLogin = useSetRecoilState(isLogin);

const checkIsLogin = async () => {
setIsLogin(await checkTokenValid());
};

useEffect(() => {
setIsLogin(checkTokenValid());
checkIsLogin();
}, []);
return (
<>
Expand Down

0 comments on commit 9b52615

Please sign in to comment.