Skip to content

Commit

Permalink
use include to validate theme value
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Li <[email protected]>
  • Loading branch information
joshuali925 committed Aug 29, 2024
1 parent 729b030 commit a6f9184
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/legacy/ui/ui_render/bootstrap/startup.js.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ try {
if (!urlThemeParam && window.location.hash.includes('?')) {
urlThemeParam = new URLSearchParams(window.location.hash.split('?')[1]).get('theme');
}
if (
urlThemeParam !== null &&
urlThemeParam !== 'dark' &&
urlThemeParam !== 'light' &&
urlThemeParam !== 'browser'
) {
if (![null, 'dark', 'light', 'browser'].includes(urlThemeParam)) {
throw new Error('theme must be "browser", "light", or "dark", received ' + urlThemeParam);
urlThemeParam = null;
}
Expand Down

0 comments on commit a6f9184

Please sign in to comment.