Skip to content

Commit

Permalink
rename action
Browse files Browse the repository at this point in the history
  • Loading branch information
sorax committed Dec 24, 2024
1 parent e25a31f commit b8881b7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions assets/js/hooks/events/listener/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export function processEvent(action, event) {
const cursorAtEnd = start == content?.length && stop == content?.length;

switch (action) {
case "new_empty_node":
case "split":
event.preventDefault();
this.pushEventTo(this.el, "new", { uuid, start, stop });
this.pushEventTo(this.el, "split", { uuid, start, stop });
break;

case "indent":
Expand Down
2 changes: 1 addition & 1 deletion assets/js/hooks/mapping.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"content": [
{
"action": "new_empty_node",
"action": "split",
"key": "Enter"
},
{
Expand Down
2 changes: 1 addition & 1 deletion lib/radiator_web/live/components/outline.ex
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ defmodule RadiatorWeb.Components.Outline do
|> reply(:noreply)
end

def handle_event("new", %{"uuid" => uuid, "start" => start, "stop" => stop}, socket) do
def handle_event("split", %{"uuid" => uuid, "start" => start, "stop" => stop}, socket) do
user_id = socket.assigns.user_id
Dispatch.split_node(uuid, {start, stop}, user_id, generate_event_id(socket.id))

Expand Down
2 changes: 1 addition & 1 deletion test/radiator_web/live/outline_live_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ defmodule RadiatorWeb.OutlineLiveTest do

assert live
|> element(stream_id)
|> render_hook(:new, params)
|> render_hook(:split, params)

keep_liveview_alive()

Expand Down

0 comments on commit b8881b7

Please sign in to comment.