mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-11 23:44:23 +08:00
Rename from subscribe
to subscribe_to_logout
This commit is contained in:
parent
078f9b9c60
commit
8d432b7ded
3 changed files with 4 additions and 4 deletions
|
@ -280,8 +280,8 @@ defmodule LivebookWeb.SessionHelpers do
|
||||||
@doc """
|
@doc """
|
||||||
Subscribes to #{@logout_topic} topic.
|
Subscribes to #{@logout_topic} topic.
|
||||||
"""
|
"""
|
||||||
@spec subscribe() :: :ok | {:error, term()}
|
@spec subscribe_to_logout() :: :ok | {:error, term()}
|
||||||
def subscribe do
|
def subscribe_to_logout do
|
||||||
Phoenix.PubSub.subscribe(Livebook.PubSub, @logout_topic)
|
Phoenix.PubSub.subscribe(Livebook.PubSub, @logout_topic)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ defmodule LivebookWeb.AppAuthHook do
|
||||||
|
|
||||||
def on_mount(:default, %{"slug" => slug}, session, socket) do
|
def on_mount(:default, %{"slug" => slug}, session, socket) do
|
||||||
if connected?(socket) do
|
if connected?(socket) do
|
||||||
LivebookWeb.SessionHelpers.subscribe()
|
LivebookWeb.SessionHelpers.subscribe_to_logout()
|
||||||
end
|
end
|
||||||
|
|
||||||
livebook_authenticated? = livebook_authenticated?(session, socket)
|
livebook_authenticated? = livebook_authenticated?(session, socket)
|
||||||
|
|
|
@ -9,7 +9,7 @@ defmodule LivebookWeb.SidebarHook do
|
||||||
def on_mount(:default, _params, _session, socket) do
|
def on_mount(:default, _params, _session, socket) do
|
||||||
if connected?(socket) do
|
if connected?(socket) do
|
||||||
Livebook.Hubs.Broadcasts.subscribe([:crud, :connection])
|
Livebook.Hubs.Broadcasts.subscribe([:crud, :connection])
|
||||||
LivebookWeb.SessionHelpers.subscribe()
|
LivebookWeb.SessionHelpers.subscribe_to_logout()
|
||||||
Phoenix.PubSub.subscribe(Livebook.PubSub, "sidebar")
|
Phoenix.PubSub.subscribe(Livebook.PubSub, "sidebar")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue