ashishdommety / tutor-times

An application for tutors to enhance the learning experience of their students & optimize work they don't want to do
0 stars 0 forks source link

Page refresh causes state loss #48

Open ashishdommety opened 5 years ago

ashishdommety commented 5 years ago

Refreshing the page causes state loss, which causes some values to break.

This is because the data saved in localStorage is saved after the user clicks login, and not in the actual response from the database itself (where it should be happening).

So, while we get a lot of data from google and store it in local storage, like:

We don't store other values that are unique to the data store like:

To remedy this, we need to store user values in localStorage after we receive them from the database the first time a.k.a in the response block in:

src/actionCreators/async/users/fetchUserAsync.js