Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

Conversation

@arunmishra2000
Copy link

No description provided.

Comment on lines +79 to 90
const loadUserInfo = () => {
// Get user details from localStorage and save to react store
try {
var info = localStorage.getItem("userInfo");
let info = localStorage.getItem("userInfo");
if (info) {
let userInfo = JSON.parse(info);
console.log("Loaded UserId from storage : " + userInfo.userId);
console.log("Loaded token from storage : " + userInfo.token);
this.props.setCurrentUser({
props.setCurrentUser({
userId: userInfo.userId,
token: userInfo.token,
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be better if we just destructure the user info and use it to set the current user . use const instead of var or let

Copy link

@alaahatem alaahatem Nov 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 try {
      const info = localStorage.getItem("userInfo");
      if (info) {
        const {userId , token) = JSON.parse(info);
        console.log("Loaded UserId from storage : " + userInfo.userId);
        console.log("Loaded token from storage : " + userInfo.token);
        this.props.setCurrentUser({
        props.setCurrentUser({
          userId,
          token
        });

Comment on lines +99 to +101
const onMenuToggle = () => {
setOverlay(!overlay);
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change this to
const onMenuToggle = () => setOverlay(!overlay);

Copy link

@alaahatem alaahatem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Job but think some changes need to be applied first

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants