-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Update Components List Styles (#8254) #8317
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1 @@ | ||||||||||||||||
| document.body.classList.add(localStorage.getItem('dx-devextreme-site-framework')); | ||||||||||||||||
|
||||||||||||||||
| document.body.classList.add(localStorage.getItem('dx-devextreme-site-framework')); | |
| var framework = localStorage.getItem('dx-devextreme-site-framework'); | |
| var allowedFrameworks = ['jquery', 'angular', 'vue', 'react']; | |
| if (framework && allowedFrameworks.indexOf(framework) !== -1) { | |
| document.body.classList.add(framework); | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code directly adds the value from localStorage to classList without any validation or null checking. If the localStorage key does not exist, getItem returns null, which could cause classList.add to add the string "null" as a class name. Consider adding a guard to check if the value exists before adding it to the classList.