refac: use update/3 to change handle_topic?

Untracked files:
This commit is contained in:
João Paulo Dubas 2024-10-09 23:53:20 +00:00
parent b05b844b6c
commit 091a60eea4
Signed by: joao.dubas
SSH Key Fingerprint: SHA256:V1mixgOGRc/YMhGx/DNkOSmJxgA2vHNrDZEk3wt/kOA

View File

@ -30,6 +30,6 @@ defmodule SlaxWeb.ChatRoomLive do
end
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