Commit 3d2765f7 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'feat/add_env_flag_to_disable_peek' into 'master'

Update the switch of Performance Bar

See merge request gitlab-org/gitlab!62675
parents 67600c27 91490dca
......@@ -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?
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment