diff --git a/pac-man-board-game/ClientApp/src/components/navMenu.tsx b/pac-man-board-game/ClientApp/src/components/navMenu.tsx index 86401a9..e453c99 100644 --- a/pac-man-board-game/ClientApp/src/components/navMenu.tsx +++ b/pac-man-board-game/ClientApp/src/components/navMenu.tsx @@ -21,15 +21,13 @@ const NavMenu: FC = () => { Home Lobby { - player === undefined ? /* TODO thisPlayerAtom contains a player object, from sessionStorage */ + player === undefined ? Login :
  • } - - {/*TODO show signed in user when signed in, otherwise login button*/} diff --git a/pac-man-board-game/ClientApp/src/utils/state.ts b/pac-man-board-game/ClientApp/src/utils/state.ts index 8759547..e6465eb 100644 --- a/pac-man-board-game/ClientApp/src/utils/state.ts +++ b/pac-man-board-game/ClientApp/src/utils/state.ts @@ -39,11 +39,11 @@ export const thisPlayerAtom = atom(get => { } return atomValue; }, (get, set, player: Player | undefined) => { - set(playerAtom, player); if (player) sessionStorage.setItem(playerStorage, JSON.stringify(player)); else sessionStorage.removeItem(playerStorage); + set(playerAtom, player); }); /** * All dice that have been rolled.