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

Add default and value check for theme user specific keys #6714

Closed
wants to merge 2 commits into from

Conversation

ananzh
Copy link
Member

@ananzh ananzh commented May 3, 2024

Issues Resolved

#6704

Changelog

  • fix: Add default and value check for theme user specific keys

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Copy link

codecov bot commented May 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.70%. Comparing base (b5121d3) to head (292726f).

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           
Flag Coverage Δ
Linux_1 33.18% <ø> (ø)
Linux_2 55.59% <ø> (ø)
Linux_3 45.25% <ø> (ø)
Linux_4 34.84% <ø> (ø)
Windows_1 33.20% <ø> (ø)
Windows_2 55.56% <ø> (ø)
Windows_3 45.26% <ø> (ø)
Windows_4 34.84% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -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;
Copy link
Member

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 = '';
Copy link
Member

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';
Copy link
Member

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

@ananzh ananzh closed this May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants