summaryrefslogtreecommitdiff
path: root/lib/lsg_web/live/chat_live.ex
diff options
context:
space:
mode:
authorhref <href@random.sh>2021-09-07 05:28:02 +0200
committerhref <href@random.sh>2021-09-07 05:28:02 +0200
commitcf7b21afa87ca5202bd626d26a60adab1e9131a1 (patch)
tree245cbb332e9ab63a2b84e4168e0ce750dc1e7ae9 /lib/lsg_web/live/chat_live.ex
parentuser_track: fix find_by_account/2 (diff)
web: openid & various fixes
Diffstat (limited to 'lib/lsg_web/live/chat_live.ex')
-rw-r--r--lib/lsg_web/live/chat_live.ex7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/lsg_web/live/chat_live.ex b/lib/lsg_web/live/chat_live.ex
index d736d72..e7a44db 100644
--- a/lib/lsg_web/live/chat_live.ex
+++ b/lib/lsg_web/live/chat_live.ex
@@ -22,7 +22,10 @@ defmodule LSGWeb.ChatLive do
Map.put(acc, id, user)
end)
- {backlog, _} = LSG.IRC.BufferPlugin.select_buffer(connection.network, chan)
+ backlog = case LSG.IRC.BufferPlugin.select_buffer(connection.network, chan) do
+ {backlog, _} -> Enum.reverse(backlog)
+ _ -> []
+ end
socket = socket
|> assign(:connection_id, connection.id)
@@ -31,7 +34,7 @@ defmodule LSGWeb.ChatLive do
|> assign(:title, "live")
|> assign(:channel, chan)
|> assign(:account_id, account.id)
- |> assign(:backlog, Enum.reverse(backlog))
+ |> assign(:backlog, backlog)
|> assign(:users, users)
|> assign(:counter, 0)