 
   def topic(%Socket{} = socket), do: "board:#{socket.assigns.board.id}"
   def topic(board_id), do: "board:#{board_id}"
+
+  def user(%Socket{assigns: %{user: user}}), do: user
+
+  def user_id(%Socket{assigns: %{user: %{id: id}}}), do: id
 
   defp finish_card_edit(socket) do
     Presence.update(

  end

  def handle_event("like", card_id, socket) do
    {:like, id: card_id, user: %User{id: socket.assigns.user.id}}
    |> live_board_action(socket)

    {:noreply, socket}
  end



  def handle_event("add_card", col_id, socket) do
    {:ok, %{card: new_card}} =
      {:add_and_lock_card, col_id: col_id, user_id: user_id(socket)}
      |> live_board_action(socket)

    {:noreply, presence_lock_card(socket, new_card)}
