From 95807b3884cbbb09044ee358f725004a1355e721 Mon Sep 17 00:00:00 2001
From: Felix Eckhofer <felix@eckhofer.com>
Date: Wed, 1 Jan 2025 18:08:16 +0100
Subject: [PATCH] Fix dark mode for users not logged in

---
 app/helpers/application_helper.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 268d351..7f9c10f 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -4,7 +4,7 @@ module ApplicationHelper
     attributes[:loggedin_uid] = current_user.id if user_signed_in?
     attributes[:is_shiftcoordinator] = 1 if current_user&.shiftcoordinator?
     attributes[:languages_from] = current_user.languages_from unless current_user&.languages_from.blank?
-    attributes[:darkmode] = current_user.darkmode
+    attributes[:darkmode] = current_user&.darkmode || "auto"
     { data: attributes }
   end
 end
-- 
GitLab