Skip to content

Commit

Permalink
fix: make sure the redux state is triggered
Browse files Browse the repository at this point in the history
Also move the sign out
  • Loading branch information
bjarneo committed Apr 11, 2023
1 parent 5acdf1e commit cb1730e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/client/components/header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const Header = () => {
dispatch(userLogin(cookie));
dispatch(userLoginChanged(true));
}
}, []);
}, [isLoggedIn, username]);

const onSignOut = () => {
toggle();
Expand Down Expand Up @@ -77,6 +77,14 @@ const Header = () => {
</>
)}

{isLoggedIn && (
<NavLink
label={t('sign_out')}
icon={<IconLockOff size="1rem" stroke={1.5} />}
onClick={onSignOut}
/>
)}

<NavLink
label={t('account')}
icon={<IconUser size="1rem" stroke={1.5} />}
Expand All @@ -97,14 +105,6 @@ const Header = () => {
/>
</>
)}

{isLoggedIn && (
<NavLink
label={t('sign_out')}
icon={<IconLockOff size="1rem" stroke={1.5} />}
onClick={onSignOut}
/>
)}
</Group>
);
};
Expand Down

0 comments on commit cb1730e

Please sign in to comment.