Skip to content

Commit

Permalink
Refactor if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
rdk08 committed Apr 18, 2023
1 parent 402e3d3 commit bd43ed4
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/plausible_web/controllers/api/external_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,7 @@ defmodule PlausibleWeb.Api.ExternalController do
defp is_bot?(%UAInspector.Result.Bot{}), do: true

defp is_bot?(%UAInspector.Result{client: %UAInspector.Result.Client{name: "Headless Chrome"}}) do
if Application.get_env(:plausible, :system_environment) in ["staging", "rc"] do
false
else
true
end
Application.get_env(:plausible, :system_environment) not in ["staging", "rc"]
end

defp is_bot?(_), do: false
Expand Down

0 comments on commit bd43ed4

Please sign in to comment.