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

Theme settings gets whiped after a certain amount of time #373

Open
modmoto opened this issue Apr 9, 2021 · 8 comments
Open

Theme settings gets whiped after a certain amount of time #373

modmoto opened this issue Apr 9, 2021 · 8 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@modmoto
Copy link
Member

modmoto commented Apr 9, 2021

Every once in a while the theme setting in the local storage vanishes and you get undead as a default theme. Maybe related to a deployment?

@modmoto modmoto added bug Something isn't working good first issue Good for newcomers labels Apr 9, 2021
@joleb
Copy link
Contributor

joleb commented Apr 9, 2021

For me, it never changed back to undead, its may related to your browser erasing local storage from time to time?
based on the code, it only tries to read it

window.localStorage.setItem("theme", val);

LocalStorage also doesn't have an expiry date.

@modmoto
Copy link
Member Author

modmoto commented Apr 9, 2021

I just have chrome and realized that this happened some times allready. Not a big deal just wanted to mark it here so when I have some time again, I might fix it ^^

@Cepheid-UK
Copy link
Member

This happens for me on mobile (S20 android, chrome browser) but not on desktop strangely.

@modmoto
Copy link
Member Author

modmoto commented Apr 12, 2021

It just got whiped for me again and i realized I was on www.w3champions.com. When I went without www. it was my old setting again. Maybe we should redirect www. to the normal site anyways? That might also be weird with the token for example. But my guess is, that it has something to do with that.

@joleb
Copy link
Contributor

joleb commented Apr 13, 2021

If that's the case, simply check your local storage 😄
image
But redirecting from non-www to www is the best solution imo.

@modmoto
Copy link
Member Author

modmoto commented Apr 14, 2021

yes i know, the local storage was empty on www but my guess is that I have been there mutliple times aswell and set it to my theme.

I just wanted this as an reminder and maybe someone has an idea why that happens.

@RNGMonk
Copy link

RNGMonk commented Jul 27, 2021

Hey everyone,

Just checking in on this.

So we've confirmed that localStorage is different for each origin so you might get different results depending on whether you got to the tld or the www subdomain. @modmoto suggested that we do a redirect from www to the tld (or perhaps vice versa) which would solve the issue of having multiple localStorage's for the same user perceived site.

The localStorage spec indicates that the storage doesn't expire but could be cleared by the user or for deemed security reasons (whatever that means). Has anyone been able to confirm that localStorage has actually expired for the same domain on mobile or desktop?

@Cepheid-UK
Copy link
Member

Not sure on that question about localStorage but I agree re-routing the URL is probably the best solution to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants