fix: prevent back-button trap on device show page

push_patch without replace: true created a history entry loop:
/devices/:id → /devices/:id?tab=overview, so hitting back would
immediately redirect forward again, trapping the user.
This commit is contained in:
Graham McIntire 2026-02-12 13:09:34 -06:00
parent 02f1af6fe3
commit f106d4c801
No known key found for this signature in database

View file

@ -66,7 +66,7 @@ defmodule ToweropsWeb.DeviceLive.Show do
{:noreply, socket}
else
# Redirect to add default tab to URL
{:noreply, push_patch(socket, to: ~p"/devices/#{id}?tab=overview")}
{:noreply, push_patch(socket, to: ~p"/devices/#{id}?tab=overview", replace: true)}
end
{:error, :not_found} ->