madhushreeag commented on code in PR #41007:
URL: https://github.com/apache/superset/pull/41007#discussion_r3531600238


##########
superset-frontend/src/theme/ThemeController.ts:
##########
@@ -696,9 +702,18 @@ export class ThemeController {
       hasValidDefault && !this.isEmptyTheme(defaultTheme);
     const hasCustomDark = hasValidDark && !this.isEmptyTheme(darkTheme);
 
+    const modeMap: Record<string, ThemeMode> = {
+      default: ThemeMode.DEFAULT,
+      dark: ThemeMode.DARK,
+      system: ThemeMode.SYSTEM,
+    };
+    const bootstrapDefaultMode: ThemeMode =
+      (defaultMode && modeMap[defaultMode]) || ThemeMode.SYSTEM;

Review Comment:
   The Object.hasOwn(modeMap, defaultMode) guard ensures only own enumerable 
keys ('default', 'dark', 'system') are accepted



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to