Skip to content

Commit

Permalink
do not preprocess move node events, therefor they should not be filtered
Browse files Browse the repository at this point in the history
  • Loading branch information
electronicbites committed Sep 10, 2024
1 parent bc43fd0 commit 8ff5a1a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/radiator_web/live/episode_live/index.ex
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ defmodule RadiatorWeb.EpisodeLive.Index do
end

@impl true
def handle_info(%NodeMovedEvent{} = event, socket), do: proxy_event(event, socket)

def handle_info(%{uuid: <<_::binary-size(36)>> <> ":" <> id} = event, %{id: id} = socket) do
socket
|> stream_event(event)
Expand All @@ -69,7 +71,6 @@ defmodule RadiatorWeb.EpisodeLive.Index do

def handle_info(%NodeInsertedEvent{} = event, socket), do: proxy_event(event, socket)
def handle_info(%NodeContentChangedEvent{} = event, socket), do: proxy_event(event, socket)
def handle_info(%NodeMovedEvent{} = event, socket), do: proxy_event(event, socket)
def handle_info(%NodeDeletedEvent{} = event, socket), do: proxy_event(event, socket)

defp proxy_event(event, socket) do
Expand Down
3 changes: 0 additions & 3 deletions lib/radiator_web/live/outline_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,10 @@ defmodule RadiatorWeb.OutlineComponent do
)

socket
|> push_event("move_node", %{uuid: uuid, parent_id: prev_parent_id, prev_id: prev_prev_id})
end

defp move_down(socket, _uuid, _prev_id) do
socket
# |> push_event("move_node", %{uuid: uuid, parent_id: next_parent_id, prev_id: next_uuid})
end

defp indent(socket, uuid, _prev_id) do
Expand All @@ -241,6 +239,5 @@ defmodule RadiatorWeb.OutlineComponent do
)

socket
|> push_event("move_node", %{uuid: uuid, parent_id: nil, prev_id: parent_id})
end
end

0 comments on commit 8ff5a1a

Please sign in to comment.