mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-01-30 10:47:51 +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
|
||||
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: %{})}
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue