@@ -15,28 +15,29 @@ defmodule PointingPartyWeb.RoomChannel do
15
15
{ :noreply , socket }
16
16
end
17
17
18
+ def handle_in ( "start_pointing" , _params , socket ) do
19
+ updated_socket = initialize_state ( socket )
20
+ # broadcast the "new_card" message with a payload of %{card: current_card}
21
+
22
+ { :reply , :ok , updated_socket }
23
+ end
24
+
18
25
def handle_in ( "user_estimated" , % { "points" => points } , socket ) do
19
26
# update votes for user presence
20
- # calculate votes if everyone voted with the help of the VoteCalculator
27
+ # if everyone voted, calculate story point estimate with the help of the VoteCalculator
21
28
# broadcast the 'winner'/'tie' event with a payload of %{points: points}
22
29
23
30
{ :noreply , socket }
24
31
end
25
32
26
- def handle_in ( "finalized_points" , % { "points" => points } , socket ) do
33
+ def handle_in ( "next_card" , % { "points" => points } , socket ) do
34
+ # update the current card's `points` value to `points` from the message payload
27
35
# update state by setting the current card to the next card
28
36
# broadcast the "new_card" message with a payload of %{card: new_current_card}
29
37
30
38
{ :reply , :ok , socket }
31
39
end
32
40
33
- def handle_in ( "start_pointing" , _params , socket ) do
34
- updated_socket = initialize_state ( socket )
35
- # broadcast the "new_card" message with a payload of %{card: current_card}
36
-
37
- { :reply , :ok , updated_socket }
38
- end
39
-
40
41
defp initialize_state ( % { assigns: % { cards: _cards } } = socket ) , do: socket
41
42
42
43
defp initialize_state ( socket ) do
0 commit comments