diff --git a/lib/cannery/accounts.ex b/lib/cannery/accounts.ex index ccc086b..a94d72b 100644 --- a/lib/cannery/accounts.ex +++ b/lib/cannery/accounts.ex @@ -421,16 +421,16 @@ defmodule Cannery.Accounts do ## Examples - iex> is_already_admin?(%User{role: :admin}) + iex> already_admin?(%User{role: :admin}) true - iex> is_already_admin?(%User{}) + iex> already_admin?(%User{}) false """ - @spec is_already_admin?(User.t() | nil) :: boolean() - def is_already_admin?(%User{role: :admin}), do: true - def is_already_admin?(_invalid_user), do: false + @spec already_admin?(User.t() | nil) :: boolean() + def already_admin?(%User{role: :admin}), do: true + def already_admin?(_invalid_user), do: false ## Confirmation diff --git a/lib/cannery_web/components/core_components/topbar.html.heex b/lib/cannery_web/components/core_components/topbar.html.heex index 128ed84..5b0f740 100644 --- a/lib/cannery_web/components/core_components/topbar.html.heex +++ b/lib/cannery_web/components/core_components/topbar.html.heex @@ -48,7 +48,7 @@ <%= gettext("Range") %> -
  • Accounts.is_already_admin?()} class="mx-2 my-1"> +
  • Accounts.already_admin?()} class="mx-2 my-1"> <.link navigate={~p"/invites"} class="text-white hover:underline"> <%= gettext("Invites") %> @@ -70,7 +70,7 @@
  • Accounts.is_already_admin?() and + @current_user |> Accounts.already_admin?() and function_exported?(Routes, :live_dashboard_path, 2) } class="mx-2 my-1"