diff --git a/lib/poex/pads/document_supervisor.ex b/lib/poex/pads/document_supervisor.ex index 57bdb7d..42dc8d2 100644 --- a/lib/poex/pads/document_supervisor.ex +++ b/lib/poex/pads/document_supervisor.ex @@ -6,7 +6,7 @@ defmodule Poex.Pads.DocumentDynamicSupervisor do DynamicSupervisor.start_link(__MODULE__, init_arg, name: __MODULE__) end - def start_document_supervisor(args) do + def start_document_server(args) do spec = {DocumentServer, args} DynamicSupervisor.start_child(__MODULE__, spec) end diff --git a/lib/poex_web/live/pad/pad_live.ex b/lib/poex_web/live/pad/pad_live.ex index 0c70de4..8279ff2 100644 --- a/lib/poex_web/live/pad/pad_live.ex +++ b/lib/poex_web/live/pad/pad_live.ex @@ -11,7 +11,7 @@ defmodule PoexWeb.PadLive do Document.changeset(%Document{}, %{title: "Untitled"}) |> Repo.insert() - DocumentDynamicSupervisor.start_document_supervisor(new_document) + DocumentDynamicSupervisor.start_document_server(new_document) # Redirect to the new document with its ID {:ok, push_navigate(socket, to: ~p"/pad/#{new_document.id}", replace: true)} @@ -24,7 +24,7 @@ defmodule PoexWeb.PadLive do contents: contents } = document = Repo.get!(Document, id) - DocumentDynamicSupervisor.start_document_supervisor(document) + DocumentDynamicSupervisor.start_document_server(document) # init editor and assigns with latest state from doc {:ok, assign(socket, id: id, title: title, contents: contents |> Utils.atomize_keys())}