Preserve current handover feedback

This commit is contained in:
SimpleTest 2026-08-09 16:34:18 +03:00
parent a638088322
commit f0cb936854
3 changed files with 206 additions and 192 deletions

View File

@ -591,6 +591,18 @@ defmodule WhoNeedHelpWeb.RequestLive.Show do
)
end
# The helper receives immediate feedback from the local `start` event. Suppress the
# same transition when it returns through PubSub so a delayed start broadcast cannot
# overwrite feedback from a newer action, such as handover-code verification.
defp maybe_put_status_transition_flash(
%{assigns: %{current_scope: %{user: %{id: user_id}}}} = socket,
_previous,
:in_progress,
_previous_assignment,
%{helper_id: user_id}
),
do: socket
defp maybe_put_status_transition_flash(
socket,
_previous,

File diff suppressed because it is too large Load Diff

View File

@ -1388,7 +1388,9 @@ defmodule WhoNeedHelpWeb.MutualAidLiveTest do
|> element("button[phx-click='start']")
|> render_click()
assert render(helper_view) =~ "Help is now in progress."
assert render(helper_view) =~ "Help is in progress."
refute render(helper_view) =~ "Help is now in progress."
assert render(requester_view) =~ "Help is now in progress."
requester_view
|> form("#matched-request-cancellation-form", %{