Added reload on websocket command
This commit is contained in:
parent
d662d58dd5
commit
93de2514e2
1 changed files with 6 additions and 2 deletions
|
|
@ -40,9 +40,13 @@ defmodule Pinchflat.Pages.JobTableLive do
|
|||
end
|
||||
|
||||
def mount(_params, _session, socket) do
|
||||
tasks = get_tasks()
|
||||
PinchflatWeb.Endpoint.subscribe("tasks:job_table_live")
|
||||
|
||||
{:ok, assign(socket, tasks: tasks)}
|
||||
{:ok, assign(socket, tasks: get_tasks())}
|
||||
end
|
||||
|
||||
def handle_info(%{topic: "tasks:job_table_live", event: "reload"}, socket) do
|
||||
{:noreply, assign(socket, tasks: get_tasks())}
|
||||
end
|
||||
|
||||
defp get_tasks do
|
||||
|
|
|
|||
Loading…
Reference in a new issue