fix: missing actor on tturning back from edit

This commit is contained in:
carla 2026-02-17 18:26:32 +01:00
parent 2b1f49d60a
commit ce542eae3e

View file

@ -219,6 +219,9 @@ defmodule MvWeb.CustomFieldLive.IndexComponent do
send(self(), {:editing_section_changed, nil})
end
# Get actor from assigns or fall back to socket assigns
actor = Map.get(assigns, :actor, socket.assigns[:actor])
{:ok,
socket
|> assign(assigns)
@ -228,7 +231,7 @@ defmodule MvWeb.CustomFieldLive.IndexComponent do
|> assign_new(:show_delete_modal, fn -> false end)
|> assign_new(:custom_field_to_delete, fn -> nil end)
|> assign_new(:slug_confirmation, fn -> "" end)
|> stream(:custom_fields, stream_custom_fields(assigns[:actor], self()), reset: true)}
|> stream(:custom_fields, stream_custom_fields(actor, self()), reset: true)}
end
@impl true