Git Product home page Git Product logo

Comments (7)

charmander-x avatar charmander-x commented on August 26, 2024 1

please post it here when you do so

from proshop_mern.

basir avatar basir commented on August 26, 2024

check if you update redux store after signin and you use it in app.js to show userInfo in the navbar.

from proshop_mern.

AtharvRedij avatar AtharvRedij commented on August 26, 2024

This is because we have userInfo in 3 different reducers.
userLoginReducer
userRegisterReducer
userUpdateProfileReducer

When you update profile userUpdateProfileReducer updates it's userInfo.
But your Header is connected to userLoginReducer which still has old data.

from proshop_mern.

charmander-x avatar charmander-x commented on August 26, 2024

so basically how can i do it -- some code will be helpful

from proshop_mern.

AtharvRedij avatar AtharvRedij commented on August 26, 2024

I faced a similar issue regarding registration
#19

I haven't yet written the code to fix this problem. But you will probably need to have a single userInfo object in store that all three reducers are connected. That will solve this issue. This will require a lot of changes to redux actions & reducers

from proshop_mern.

charmander-x avatar charmander-x commented on August 26, 2024

i found the fix that's probably not the correct way but its working good 😃

in user actions after USER_UPDATE_PROFILE_SUCCESS put another dispatch({
type: USER_LOGIN_SUCCESS,
payload: data,
});
localStorage.setItem("userInfo", JSON.stringify(data));

so basically it'll set userInfo to the udpated values

from proshop_mern.

bradtraversy avatar bradtraversy commented on August 26, 2024

Check the latest commits. I am adding a new video to the course now explaining. It will be the last video in the Frontend Authentication section

from proshop_mern.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.