File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -317,16 +317,17 @@ def body_data_attributes(local_assigns)
317
317
end
318
318
319
319
def user_theme_data_attributes
320
- if User . current . pref . sync_with_os_theme?
321
- # Theme will be set by inline script before body renders to prevent flickering
322
- { auto_theme_switcher_mode_value : User . current . pref . theme ,
320
+ current_user = User . current
321
+
322
+ if current_user . anonymous? || current_user . pref . sync_with_os_theme?
323
+ { auto_theme_switcher_mode_value : :sync_with_os ,
323
324
auto_theme_switcher_desktop_light_high_contrast_logo_class : "op-logo--link_high_contrast" ,
324
325
auto_theme_switcher_mobile_white_logo_class : "op-logo--icon_white" }
325
326
else
326
- mode , _theme_suffix = User . current . pref . theme . split ( "_" , 2 )
327
+ mode , _theme_suffix = current_user . pref . theme . split ( "_" , 2 )
327
328
{
328
329
color_mode : mode ,
329
- "#{ mode } _theme" : User . current . pref . theme
330
+ "#{ mode } _theme" : current_user . pref . theme
330
331
}
331
332
end
332
333
end
You can’t perform that action at this time.
0 commit comments