Flush frame outputs from state (#1798)

This commit is contained in:
Jonatan Kłosko 2023-03-17 18:30:30 +01:00 committed by GitHub
parent fc370470b2
commit c1a2c924c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,7 +3,8 @@ defmodule LivebookWeb.Output.FrameComponent do
@impl true
def mount(socket) do
{:ok, assign(socket, counter: 0, output_count: 0, persistent_id_map: %{})}
{:ok, assign(socket, counter: 0, output_count: 0, persistent_id_map: %{}),
temporary_assigns: [outputs: []]}
end
@impl true
@ -56,7 +57,7 @@ defmodule LivebookWeb.Output.FrameComponent do
:append ->
socket
|> update(:outputs, &(outputs ++ &1))
|> assign(:outputs, outputs)
|> update(:output_count, &(length(outputs) + &1))
end