-
Notifications
You must be signed in to change notification settings - Fork 893
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
Add default and value check for theme user specific keys #6714
Conversation
Issue Resolve opensearch-project#6704 Signed-off-by: Anan Zhuang <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6714 +/- ##
=======================================
Coverage 67.70% 67.70%
=======================================
Files 3417 3417
Lines 66922 66922
Branches 10888 10888
=======================================
Hits 45308 45308
Misses 18967 18967
Partials 2647 2647
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -11,8 +11,13 @@ if (window.__osdStrictCsp__ && window.__osdCspNotEnforced__) { | |||
window.console.log("^ A single error about an inline script not firing due to content security policy is expected!"); | |||
} | |||
|
|||
var isDarkMode = window.__osdThemeTag__.endsWith('dark'); | |||
var themeVersion = window.__osdThemeTag__.startsWith('v7') ? 'v7' : 'v8'; | |||
var isDarkMode = false; |
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.
Keep this the same as before no issue here
var isDarkMode = window.__osdThemeTag__.endsWith('dark'); | ||
var themeVersion = window.__osdThemeTag__.startsWith('v7') ? 'v7' : 'v8'; | ||
var isDarkMode = false; | ||
var themeVersion = ''; |
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.
If global window undefined no theme will be set
|
||
if (window.__osdThemeTag__) { | ||
isDarkMode = window.__osdThemeTag__.endsWith('dark'); | ||
themeVersion = window.__osdThemeTag__.startsWith('v7') ? 'v7' : 'v8'; |
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.
Instead using a nested if statement can't we just do.
Check if it's undefined here or not and get the value
Issues Resolved
#6704
Changelog
Check List
yarn test:jest
yarn test:jest_integration