fix: another Mix.env() call in device_live/index.ex

- Fixed debounce_ms/0 function still using Mix.env()
- Changed to Application.get_env(:towerops, :env)
- This was causing crashes in staging/production
This commit is contained in:
Graham McIntire 2026-03-09 14:59:41 -05:00
parent d811bcb503
commit 34e9365520
No known key found for this signature in database
2 changed files with 12 additions and 12 deletions

View file

@ -36,19 +36,19 @@
<h1 class="text-2xl font-bold text-gray-900 dark:text-white">
{t_auth("Log in")}
</h1>
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">
<%= if @current_scope do %>
<%= if @current_scope do %>
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">
{t_auth("You need to reauthenticate to perform sensitive actions on your account.")}
<% else %>
{t_auth("Don't have an account?")}
<.link
navigate={~p"/users/register"}
class="font-semibold text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300"
>
{t_auth("Sign up")}
</p>
<% else %>
<div class="mt-4">
<.link navigate={~p"/users/register"}>
<.button class="w-full" variant="secondary">
{t_auth("Create an account")} <span aria-hidden="true">→</span>
</.button>
</.link>
<% end %>
</p>
</div>
<% end %>
</div>
<div

View file

@ -294,7 +294,7 @@ defmodule ToweropsWeb.DeviceLive.Index do
end
defp debounce_ms do
if Mix.env() == :test, do: 0, else: 100
if Application.get_env(:towerops, :env) == :test, do: 0, else: 100
end
defp schedule_debounced_reload(socket, event) do