Make sure to reflect the dirty status when cell content changes (#465)

This commit is contained in:
Jonatan Kłosko 2021-07-26 11:33:44 +02:00 committed by GitHub
parent ed8fac44ef
commit 943d8b6059
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1181,7 +1181,9 @@ defmodule LivebookWeb.SessionLive do
data_view
{:apply_cell_delta, _pid, cell_id, _delta, _revision} ->
update_cell_view(data_view, data, cell_id)
data_view
|> update_cell_view(data, cell_id)
|> update_dirty_status(data)
_ ->
data_to_view(data)
@ -1198,4 +1200,10 @@ defmodule LivebookWeb.SessionLive do
cell_view
)
end
# Changes that affect only a single cell are still likely to
# have impact on dirtyness, so we need to always mirror it
defp update_dirty_status(data_view, data) do
put_in(data_view.dirty, data.dirty)
end
end