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: allow UI settings to persist #21

Merged
merged 1 commit into from
Jul 26, 2023
Merged

Conversation

pbui
Copy link
Contributor

@pbui pbui commented Jul 26, 2023

UI settings were being overwritten on refresh. Changing this check appears to resolve this issue and allows for the UI settings to persist.

@vercel
Copy link

vercel bot commented Jul 26, 2023

Someone is attempting to deploy a commit to a Personal Account owned by @Xyphyn on Vercel.

@Xyphyn first needs to authorize it.

@Xyphyn
Copy link
Owner

Xyphyn commented Jul 26, 2023

I'm unsure why I even have this mergeObjects function as a simple { ...obj1, ...obj2 } would probably work

@vercel
Copy link

vercel bot commented Jul 26, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
photon ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 26, 2023 4:24pm

@Xyphyn
Copy link
Owner

Xyphyn commented Jul 26, 2023

The issue you're stating only seems to occur on some settings. I assume it's not saving actually, could you check local storage after you change a setting?

@pbui
Copy link
Contributor Author

pbui commented Jul 26, 2023

I did check the local storage and it was updating there. The issue appears to have been the mergeObjects function, which was overwriting the stored values.

@pbui
Copy link
Contributor Author

pbui commented Jul 26, 2023

Here is a screenshot from the [nu.lemdro.id] instance:

Screenshot from 2023-07-26 11-27-29

As you can see the revertColors and showInstance settings are updated in the local storage object.

UI settings were being overwritten on refresh. Changing this check
appears to resolve this issue and allows for the UI settings to persist.
@pbui
Copy link
Contributor Author

pbui commented Jul 26, 2023

I've updated the PR to remove the mergeObjects function and simply use the spread operator as you suggested.

I tested it briefly and this appears to work fine for allowing settings to persist.

@Xyphyn
Copy link
Owner

Xyphyn commented Jul 26, 2023

This works! Thanks for your contribution!

@Xyphyn Xyphyn merged commit d696e2e into Xyphyn:main Jul 26, 2023
3 checks passed
pbui added a commit to pbui/photon that referenced this pull request Jul 26, 2023
UI settings were being overwritten on refresh. Changing this check
appears to resolve this issue and allows for the UI settings to persist.
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.

None yet

2 participants