Skip to content

Commit

Permalink
remove unnecessary calls to localstorage
Browse files Browse the repository at this point in the history
  • Loading branch information
pelazas committed Apr 29, 2024
1 parent 11991b8 commit 89cdb17
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface LobbyMultiPlayerProps {
const LobbyMultiPlayer: FC<LobbyMultiPlayerProps> = ({ socket, handleCurrentStage, partyCode, users }) => {
const [isFetched, setFetched] = useState<boolean>(true);

const uuid = localStorage.getItem("uuid");
const uuid = localStorage.getItem("userUUID");
console.log(uuid);

const { t } = useTranslation();
Expand Down
3 changes: 0 additions & 3 deletions webapp/src/components/login/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,9 @@ const Login = (props: ActionProps) => {

try {
const user = await axios.post(`${apiEndpoint}/login`, { username, password });
console.log(user.data);

localStorage.setItem("username", user.data.username);
localStorage.setItem("score", user.data.totalScore);
localStorage.setItem("nWins", user.data.nWins);
localStorage.setItem("uuid", user.data.uuid);
localStorage.setItem("isAuthenticated", JSON.stringify(true));
// Extract data from the response
localStorage.setItem('userUUID', user.data.uuid);
Expand Down
3 changes: 0 additions & 3 deletions webapp/src/components/register/Register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@ const Register = (props:ActionProps) => {
setOpenSnackbar(true);
const user = await axios.post(`${apiEndpoint}/login`, { username, password });

console.log(user.data);
localStorage.setItem("username", user.data.username);
localStorage.setItem("score", user.data.totalScore);
localStorage.setItem("nWins", user.data.nWins);
localStorage.setItem("uuid", user.data.uuid);
localStorage.setItem("isAuthenticated", JSON.stringify(true));
// Extract data from the response
localStorage.setItem('userUUID', user.data.uuid);
Expand Down

0 comments on commit 89cdb17

Please sign in to comment.