This commit is contained in:
@@ -77,6 +77,9 @@ Hooks.ScrollBottom = {
|
|||||||
if (this.isNearBottom()) this.scrollToBottom()
|
if (this.isNearBottom()) this.scrollToBottom()
|
||||||
})
|
})
|
||||||
this.observer.observe(this.el, {childList: true, subtree: true})
|
this.observer.observe(this.el, {childList: true, subtree: true})
|
||||||
|
this.handleEvent("scroll_to_bottom", () => {
|
||||||
|
this.scrollToBottom()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
updated() {
|
updated() {
|
||||||
if (this.isNearBottom()) this.scrollToBottom()
|
if (this.isNearBottom()) this.scrollToBottom()
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ metadata:
|
|||||||
namespace: ai-ha-elixir
|
namespace: ai-ha-elixir
|
||||||
spec:
|
spec:
|
||||||
serviceName: ai-ha-elixir-headless
|
serviceName: ai-ha-elixir-headless
|
||||||
replicas: 3
|
replicas: 2
|
||||||
podManagementPolicy: Parallel
|
podManagementPolicy: Parallel
|
||||||
updateStrategy:
|
updateStrategy:
|
||||||
type: RollingUpdate
|
type: RollingUpdate
|
||||||
rollingUpdate:
|
rollingUpdate:
|
||||||
maxUnavailable: 2
|
maxUnavailable: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: ai-ha-elixir
|
app: ai-ha-elixir
|
||||||
|
|||||||
@@ -104,7 +104,10 @@ defmodule ElixirAiWeb.ChatLive do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def handle_info({:user_chat_message, message}, socket) do
|
def handle_info({:user_chat_message, message}, socket) do
|
||||||
{:noreply, update(socket, :messages, &(&1 ++ [message]))}
|
{:noreply,
|
||||||
|
socket
|
||||||
|
|> update(:messages, &(&1 ++ [message]))
|
||||||
|
|> push_event("scroll_to_bottom", %{})}
|
||||||
end
|
end
|
||||||
|
|
||||||
def handle_info(
|
def handle_info(
|
||||||
|
|||||||
Reference in New Issue
Block a user