refac: use update/3 to change handle_topic?

Untracked files:
This commit is contained in:
2024-10-09 23:53:20 +00:00
parent b05b844b6c
commit 091a60eea4

View File

@@ -30,6 +30,6 @@ defmodule SlaxWeb.ChatRoomLive do
end end
def handle_event("toggle-topic", _params, socket) do def handle_event("toggle-topic", _params, socket) do
{:noreply, assign(socket, hide_topic?: !socket.assigns.hide_topic?)} {:noreply, update(socket, :hide_topic?, &(!&1))}
end end
end end