gabotorresruiz commented on code in PR #35220:
URL: https://github.com/apache/superset/pull/35220#discussion_r2373172722


##########
superset-frontend/src/theme/ThemeController.ts:
##########
@@ -572,6 +589,30 @@ export class ThemeController {
     );
   }
 
+  /**
+   * Checks if a theme is truly empty (not even an algorithm).
+   * A theme with just an algorithm is still valid and should be used.
+   */
+  private isEmptyTheme(theme: any): boolean {
+    if (!theme) return true;
+
+    // If it's an empty object {}, it's empty
+    if (typeof theme === 'object' && Object.keys(theme).length === 0)
+      return true;
+
+    // If theme has an algorithm, it's not empty (even without tokens)
+    if (theme.algorithm) return false;
+
+    // Check if theme has any tokens defined
+    if (theme.token && Object.keys(theme.token).length > 0) return false;
+
+    // Check if theme has components defined
+    if (theme.components && Object.keys(theme.components).length > 0)
+      return false;
+
+    return true;
+  }

Review Comment:
   You're right, I was overcomplicating things here. Thanks, nice catch!



-- 
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