mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-07 03:57:06 +08:00
Only subscribe if connected
This commit is contained in:
parent
ec90333a00
commit
a05d6c5059
1 changed files with 3 additions and 1 deletions
|
@ -9,7 +9,9 @@ defmodule LivebookWeb.Hub.EditLive do
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def mount(_params, _session, socket) do
|
def mount(_params, _session, socket) do
|
||||||
Hubs.subscribe([:connection])
|
if connected?(socket) do
|
||||||
|
Hubs.subscribe([:connection])
|
||||||
|
end
|
||||||
|
|
||||||
{:ok, assign(socket, hub: nil, type: nil, page_title: "Hub - Livebook", params: %{})}
|
{:ok, assign(socket, hub: nil, type: nil, page_title: "Hub - Livebook", params: %{})}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue