diff --git a/lib/live_debugger/app/debugger/async_jobs/web/async_jobs_live.ex b/lib/live_debugger/app/debugger/async_jobs/web/async_jobs_live.ex index 671aac5cf..c8fd9dac2 100644 --- a/lib/live_debugger/app/debugger/async_jobs/web/async_jobs_live.ex +++ b/lib/live_debugger/app/debugger/async_jobs/web/async_jobs_live.ex @@ -81,7 +81,7 @@ defmodule LiveDebugger.App.Debugger.AsyncJobs.Web.AsyncJobsLive do <%= async_jobs_failed(@async_jobs) %>
- No async jobs found + No active async jobs found
<.async_job :for={async_job <- async_jobs} @@ -148,6 +148,12 @@ defmodule LiveDebugger.App.Debugger.AsyncJobs.Web.AsyncJobsLive do |> noreply() end + def handle_async(:fetch_async_jobs, {:ok, {:error, :not_alive_or_not_a_liveview}}, socket) do + socket + |> assign(:async_jobs, AsyncResult.ok([])) + |> noreply() + end + def handle_async(:fetch_async_jobs, {:ok, {:error, reason}}, socket) do socket |> assign(:async_jobs, AsyncResult.failed(AsyncResult.loading(), reason)) diff --git a/test/e2e/async_jobs_test.exs b/test/e2e/async_jobs_test.exs index 35e1633cf..76223b986 100644 --- a/test/e2e/async_jobs_test.exs +++ b/test/e2e/async_jobs_test.exs @@ -98,7 +98,7 @@ defmodule LiveDebugger.E2E.AsyncJobsTest do defp async_job_name(name), do: css("#async-jobs p.font-medium", text: name) - defp no_async_jobs(), do: css("#async-jobs", text: "No async jobs found") + defp no_async_jobs(), do: css("#async-jobs", text: "No active async jobs found") defp node_module_info(text), do: css("#node-inspector-basic-info-current-node-module", text: text)