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

Fix: Move search count from cookie to local storage #48

Open
gsambrotta opened this issue Apr 1, 2021 · 6 comments
Open

Fix: Move search count from cookie to local storage #48

gsambrotta opened this issue Apr 1, 2021 · 6 comments
Assignees
Labels
fix something to improve or quickly fix

Comments

@gsambrotta
Copy link
Collaborator

We are considering saving search count to localStorage instead of cookies mostly to not have an expiration date.
Everything else should stay the same.

Happy to hear feedbacks about that.

@gsambrotta gsambrotta added the fix something to improve or quickly fix label Apr 1, 2021
@KitanGarcia
Copy link

Hello, @gsambrotta and @ElliotForWater/elliotforwater-core-dev! I've been newly acquainted with your project and would love to help! Are you still working on this issue? If so, I'd be happy to take it on.

@gsambrotta
Copy link
Collaborator Author

Hi @KitanGarcia Thank you for your interest in contributing to Elliot for Water.
Yes this issue is still needed.
Right now we are saving the search count (what you see next to the drop icon, in the right top corner of the header) as cookies but doing so we do an extra call to the server and we also have an expiration date.
We were considering moving to the local storage for those reasons.

Any pro or cons you see in these solutions?
Let me know what do you think and if you need any other information.

@KitanGarcia
Copy link

Thanks for the response, @gsambrotta . After doing some research on my end, I do think that going with LocalStorage is the best way to go about things, due to exactly what you've mentioned.

Unfortunately, I'm actually unable to get the project running at the moment. It must be some rookie mistake on my part somewhere. I'm following this link: https://github.com/ElliotForWater/elliotforwater.com/wiki/1.-Set-up-and-usage
Can you help?

After cloning and entering the repo, I ran:
npm install
npm run dev

I got an error pertaining to env-cmd, so I tried some suggestions on stack overflow (running different commands and using -e instead of -f), and also installed env-cmd globally. I have not modified the dev script in package.json at all. When I run npm run dev, the error I have now is Error: Failed to find .env file at path: .env.development at getEnvFile (/home/kitan/Projects/orgs/ElliotForWater/efw-webapp/node_modules/env-cmd/dist/get-env-vars.js:40:19)

@gsambrotta
Copy link
Collaborator Author

@KitanGarcia The .env file is missing. In your copy of the project, you should have a file called .env.development.example, If you open it you will see a comment that says to copy that file and rename it .env.development
After doing that, npm run dev should run without problem.
I will add this part to the documentation. Thank you for mentioning

@KitanGarcia
Copy link

@gsambrotta Just to clarify, you just want the search count to be moved to local storage, correct? The rest of the cookies stay as cookies and do not be made part of local storage?

@gsambrotta
Copy link
Collaborator Author

Yes, for the moment we can move just the search count. Then we can see later about the other cookies. Thanks @KitanGarcia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix something to improve or quickly fix
Projects
None yet
Development

No branches or pull requests

2 participants