summaryrefslogtreecommitdiff
path: root/app/controllers/concerns/with_performance_bar.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/concerns/with_performance_bar.rb')
-rw-r--r--app/controllers/concerns/with_performance_bar.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/app/controllers/concerns/with_performance_bar.rb b/app/controllers/concerns/with_performance_bar.rb
index dc2265e063a..adfad4de4dd 100644
--- a/app/controllers/concerns/with_performance_bar.rb
+++ b/app/controllers/concerns/with_performance_bar.rb
@@ -20,12 +20,11 @@ module WithPerformanceBar
end
def cookie_or_default_value
- cookie_enabled = if cookies[:perf_bar_enabled].present?
- cookies[:perf_bar_enabled] == 'true'
- else
- cookies[:perf_bar_enabled] = 'true' if Rails.env.development?
- end
+ if cookies[:perf_bar_enabled].blank? && Rails.env.development?
+ cookies[:perf_bar_enabled] = 'true'
+ end
+ cookie_enabled = cookies[:perf_bar_enabled] == 'true'
cookie_enabled && Gitlab::PerformanceBar.allowed_for_user?(current_user)
end
end