-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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] Hightlights validation on Account Preferences page #19902
Conversation
It's not necessary to add another state to check changes
@dougfabris should I open a separate issue for the other issue that occurs because of no page refresh? |
@aKn1ghtOut the fix should properly solve both now, can you check? btw thanks for helping us =) |
Just checked. The "first issue" described above is still there. I do however doubt that it may be out of scope for the Issue being referenced here since it would warrant a uniform approach to solve it on all settings pages. |
I just opened #19927 to allow more space for that bug specifically. If a different issue seems unnecessary, it can be closed and maybe, the discussion could be done on this PR itself. |
@aKn1ghtOut Ok thanks. I'll fix the description and check the other issue separately! |
Checklist
Proposed changes
This PR fixes two issues in the account settings "preferences" panel.
Once set, the "Highlighted Words" setting cannot be reset to an empty string. This was fixed by changing the string validation from checking the length to checking the type of variable.
Secondly, it tracks the changes to correctly identify if changes after the last "save changes" action have been made, using an "updates" state variable, instead of just comparing against the initialValue that does not change on clicking "save changes".
Issue(s)
Fixes issue #19896
Steps to test or reproduce
Reproduce in order.
Further comments
The first issue will affect other settings pages too. There are two solutions I considered to this: The one implemented here or simply reloading the webpage on clicking "Save Changes". The project should pick one approach and that should be implemented for all the settings pages.