Skip to content

Commit

Permalink
Always re-evaluate changes based on selected n
Browse files Browse the repository at this point in the history
  • Loading branch information
dersmon committed Jun 10, 2024
1 parent 529287b commit cda2033
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server/lib/field_hub_web/live/project_show_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,14 @@ defmodule FieldHubWeb.ProjectShowLive do
end
end

def handle_info(:update_overview, %{assigns: %{project: project}} = socket) do
def handle_info(
:update_overview,
%{assigns: %{project: project, nb_changes_to_display: number_of_changes}} = socket
) do
# Evaluate the project asynchronously. Once the task finishes, it will get picked up
# by another handle_info/2 below.
Task.async(fn ->
{:overview_task, Project.evaluate_project(project)}
{:overview_task, Project.evaluate_project(project, number_of_changes)}
end)

{:noreply, socket}
Expand Down

0 comments on commit cda2033

Please sign in to comment.