Preserve current handover feedback
This commit is contained in:
parent
a638088322
commit
f0cb936854
|
|
@ -591,6 +591,18 @@ defmodule WhoNeedHelpWeb.RequestLive.Show do
|
||||||
)
|
)
|
||||||
end
|
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(
|
defp maybe_put_status_transition_flash(
|
||||||
socket,
|
socket,
|
||||||
_previous,
|
_previous,
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1388,7 +1388,9 @@ defmodule WhoNeedHelpWeb.MutualAidLiveTest do
|
||||||
|> element("button[phx-click='start']")
|
|> element("button[phx-click='start']")
|
||||||
|> render_click()
|
|> 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
|
requester_view
|
||||||
|> form("#matched-request-cancellation-form", %{
|
|> form("#matched-request-cancellation-form", %{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user