Skip to content

Commit

Permalink
Merge pull request #523 from eyra/feldspar-exit
Browse files Browse the repository at this point in the history
Only hiding feldspar app after exit in case of workflow item count > 1
  • Loading branch information
mellelieuwes authored Dec 13, 2023
2 parents 9ab12b9 + 6a52037 commit dd965f1
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions core/systems/assignment/crew_work_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,22 @@ defmodule Systems.Assignment.CrewWorkView do

# Private

defp handle_feldspar_event(%{assigns: %{selected_item: {_, task}}} = socket, %{
"__type__" => "CommandSystemExit",
"code" => code,
"info" => _info
}) do
defp handle_feldspar_event(
%{assigns: %{selected_item: {_, task}, work_items: work_items}} = socket,
%{
"__type__" => "CommandSystemExit",
"code" => code,
"info" => _info
}
) do
if code == 0 do
Crew.Public.activate_task(task)
socket |> hide_child(:tool_ref_view)

if Enum.count(work_items) > 1 do
socket |> hide_child(:tool_ref_view)
else
socket
end
else
Frameworks.Pixel.Flash.put_info(socket, "Application stopped")
end
Expand Down

0 comments on commit dd965f1

Please sign in to comment.