feat: set proper page title for chats rooms

This commit is contained in:
João Paulo Dubas 2024-10-15 00:35:20 +00:00
parent 0ae441c31a
commit 7de16a0ea2
Signed by: joao.dubas
SSH Key Fingerprint: SHA256:V1mixgOGRc/YMhGx/DNkOSmJxgA2vHNrDZEk3wt/kOA
2 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="csrf-token" content={get_csrf_token()} />
<.live_title suffix=" · Phoenix Framework">
<.live_title suffix=" · Slax">
<%= assigns[:page_title] || "Slax" %>
</.live_title>
<link phx-track-static rel="stylesheet" href={~p"/assets/app.css"} />

View File

@ -58,7 +58,7 @@ defmodule SlaxWeb.ChatRoomLive do
Chat.get_first_room!()
end
{:noreply, assign(socket, hide_topic?: false, room: room)}
{:noreply, assign(socket, hide_topic?: false, page_title: "# #{room.name}", room: room)}
end
@impl Phoenix.LiveView