X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/4a8ef3e26c7bd37cb47332f04bf0b50665c71fc3..045af66d438a7fa3567cb4a10ea2f6a255e742c8:/app/controllers/application_controller.rb?ds=sidebyside diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 7ce804ced..56d9a6763 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -281,7 +281,15 @@ class ApplicationController < ActionController::Base end end - helper_method :preferred_editor + def preferred_site_color_scheme + if current_user + current_user.preferences.find_by(:k => "site.color_scheme")&.v || "auto" + else + "auto" + end + end + + helper_method :preferred_editor, :preferred_site_color_scheme def update_totp if Settings.key?(:totp_key)