Skip to content

Commit ae2313f

Browse files
committed
fix: allow user to exit preview
1 parent e87f2d4 commit ae2313f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/algora_web/live/home_live.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ defmodule AlgoraWeb.HomeLive do
8989
)
9090

9191
case socket.assigns[:current_user] do
92-
nil ->
92+
%{handle: handle} = user when is_binary(handle) ->
93+
{:ok, redirect(socket, to: AlgoraWeb.UserAuth.signed_in_path(user))}
94+
95+
_ ->
9396
{:ok,
9497
socket
9598
|> assign(:page_title, "Algora - The open source Upwork for engineers")
@@ -110,9 +113,6 @@ defmodule AlgoraWeb.HomeLive do
110113
|> assign(:share_drawer_type, nil)
111114
|> assign(:show_share_drawer, false)
112115
|> assign(:transactions, transactions)}
113-
114-
user ->
115-
{:ok, redirect(socket, to: AlgoraWeb.UserAuth.signed_in_path(user))}
116116
end
117117
end
118118

0 commit comments

Comments
 (0)