-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Persists Redux store to/from sessionStorage #334
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
Persists Redux store to/from sessionStorage #334
Conversation
c948b56
to
34c4f7f
Compare
@catarak I think this is ready for review. I've manually tested this by logging in/out a few times. Saving projects and loading them again. It seems ok but I think you might be able to find some edge cases. |
This is working for me if you start on http, but if you open the page on https, and then login or sign up, then it is redirected back to http. Maybe there's something up with the https redirection that we didn't catch? Let me know if you can reproduce this. |
This is because we use the project's Maybe new projects started on HTTPS should be created with the |
Got it. My instinct is that for now, new projects started on HTTPS should be created with |
Because when a sketch is created on HTTPS and then the user logs in the page won't be reloaded
Projects created on HTTPS now have But... because of this, using this flag to figure out if we should redirect or not won't work as the blank project created on HTTPS will have So, I'm appending the querystring parameter |
Just tested this and it works great 🎉 I think the query string parameter is okay, as login/signup aren't urls that users will copy and paste. |
As required by #329 we need this for login so the user's work isn't lost.
/login
or/signup
local/sessionStorage is only available for the current origin, so data saved under
http
is not available underhttps
. This should be ok for the login use case as we'll redirect back to same protocol.I initially tried to keep the whole store synced to
sessionStorage
. This gives you some nice features like being able to refresh the page and not losing any data, but I think this would be a lot more work to make work properly.