kevinjqliu commented on code in PR #148:
URL: https://github.com/apache/datafusion-site/pull/148#discussion_r2934357449


##########
content/js/dark-mode.js:
##########
@@ -0,0 +1,42 @@
+(function() {
+    'use strict';
+
+    const root = document.documentElement;
+
+    function getTheme() {
+        return localStorage.getItem('theme') || 'light';

Review Comment:
   ```suggestion
           try {
               return localStorage.getItem('theme') || 'light';
           } catch {
               return 'light';
           }
   ```
   
   one more suggestion from claude. in case local storage is restricted by the 
browser



##########
content/js/dark-mode.js:
##########
@@ -0,0 +1,42 @@
+(function() {
+    'use strict';
+
+    const root = document.documentElement;
+
+    function getTheme() {
+        return localStorage.getItem('theme') || 'light';
+    }
+
+    function setButtonState(theme) {
+        const toggleButton = document.getElementById('dark-mode-toggle');
+        if (toggleButton) {
+            toggleButton.setAttribute('aria-pressed', theme === 'dark' ? 
'true' : 'false');
+        }
+    }
+
+    function applyTheme(theme) {
+        root.setAttribute('data-theme', theme);
+        localStorage.setItem('theme', theme);

Review Comment:
   ```suggestion
           try { localStorage.setItem('theme', theme); } catch { }
   ```
   one more suggestion from claude. in case local storage is restricted by the 
browser



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