fix: validate custom color presets from localStorage#342
Conversation
|
@mayurigade-hub is attempting to deploy a commit to the Dot_NotSam's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hello @SamXop123 |
|
🎉 Congratulations @mayurigade-hub! 🎉 Your pull request has been successfully merged into Paraline! Thank you so much for your valuable contribution and effort. Every single improvement helps make Paraline a better desktop experience for everyone! 🙌 🚀 What's Next?
💬 Stay Connected: Thank you again, and keep up the amazing work! 💻✨ |
Related Issue
Closes #322
Description
Fixed an issue where custom color presets loaded from
localStoragewere only validated for array length and not for the validity of their color values.Previously, malformed or corrupted preset data containing invalid color strings could be accepted by the application, potentially causing incorrect colors to appear or failures in the color picker.
This fix validates each preset color using a hex color pattern before adding the preset to the available presets. Invalid presets are ignored to ensure only valid hex color values are used.
Changes Made
#RRGGBBformat.localStorage.Steps to Test
BrokenPresetis not loaded or is ignored.Expected Result
#RRGGBBhex color values are loaded.Files Changed
settings.jsType of Change
☑️ Bug fix
☐ New feature
☐ Breaking change
☐ Documentation update