From 0b6acb9d34980ff0761c27fbaa22c6f75e220395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= Date: Fri, 3 Dec 2021 14:03:06 +0100 Subject: [PATCH] Hide reconnect runtime button once reconnected (#731) --- lib/livebook_web/live/output.ex | 8 ++++++-- lib/livebook_web/live/session_live/cell_component.ex | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/livebook_web/live/output.ex b/lib/livebook_web/live/output.ex index c8a470a32..30ffb4f07 100644 --- a/lib/livebook_web/live/output.ex +++ b/lib/livebook_web/live/output.ex @@ -15,6 +15,7 @@ defmodule LivebookWeb.Output do id: "#{@id}-output#{group_idx}_#{idx}", socket: @socket, runtime: @runtime, + cell_validity_status: @cell_validity_status, input_values: @input_values }) %> @@ -117,8 +118,11 @@ defmodule LivebookWeb.Output do live_component(LivebookWeb.Output.ControlComponent, id: id, attrs: attrs) end - defp render_output({:error, formatted, :runtime_restart_required}, %{runtime: runtime}) - when runtime != nil do + defp render_output({:error, formatted, :runtime_restart_required}, %{ + runtime: runtime, + cell_validity_status: cell_validity_status + }) + when runtime != nil and cell_validity_status == :evaluated do assigns = %{formatted: formatted, is_standalone: Livebook.Runtime.standalone?(runtime)} ~H""" diff --git a/lib/livebook_web/live/session_live/cell_component.ex b/lib/livebook_web/live/session_live/cell_component.ex index 056a46f23..46766ccd1 100644 --- a/lib/livebook_web/live/session_live/cell_component.ex +++ b/lib/livebook_web/live/session_live/cell_component.ex @@ -120,6 +120,7 @@ defmodule LivebookWeb.SessionLive.CellComponent do id={"cell-#{@cell_view.id}-evaluation#{evaluation_number(@cell_view.evaluation_status, @cell_view.number_of_evaluations)}-outputs"} socket={@socket} runtime={@runtime} + cell_validity_status={@cell_view.validity_status} input_values={@cell_view.input_values} /> <% end %>