Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storing API Key and recent source docs locally #115

Merged
merged 11 commits into from
Feb 24, 2023
Merged

Conversation

TaylorS15
Copy link
Collaborator

No description provided.

@ajaythapliyal
Copy link
Collaborator

ajaythapliyal commented Feb 23, 2023

Hey Taylor, although the local storage thing works but we see a flash of modal when we open the app subsequent times.
flash

} catch (error) {
console.log(error);
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any particular reasons why these local storage functions are async? AFAIK local storage web api are sync in nature. Doesnt seem like any async thing happening here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah I thuogth they maybe should be synchronous but wasnt sure. will change

@ajaythapliyal
Copy link
Collaborator

ajaythapliyal commented Feb 23, 2023

Right now the localstorage and redux are distinct and we are using them together on APIKeyModal mount. This might be the reason why the flash shows up.

There should be a better way to sync localstorage and redux together. I dont have a very concrete solution in my mind right now but looking into middlewares would be helpful. We only should be talking to redux in our component layer, rest all should be handled in other layers.

https://stackoverflow.com/questions/35305661/where-to-write-to-localstorage-in-a-redux-app
https://stackoverflow.com/questions/68421040/local-storage-using-redux-toolkit
https://github.com/rt2zz/redux-persist
https://blog.logrocket.com/persist-state-redux-persist-redux-toolkit-react/

@pabik pabik merged commit 287f75d into arc53:main Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants