PERF: Remove an unncessary query when check for dark mode.

This commit is contained in:
Guo Xiang Tan 2020-09-09 15:18:52 +08:00
parent fb7bbae3f4
commit 4994b0ed34
No known key found for this signature in database
GPG Key ID: FBD110179AAC1F20
1 changed files with 1 additions and 0 deletions

View File

@ -473,6 +473,7 @@ module ApplicationHelper
end end
def dark_color_scheme? def dark_color_scheme?
return false if scheme_id.blank?
ColorScheme.find_by_id(scheme_id)&.is_dark? ColorScheme.find_by_id(scheme_id)&.is_dark?
end end