Answer handling yay
This commit is contained in:
parent
f3020b7cb0
commit
1a410072c2
9 changed files with 79 additions and 42 deletions
|
|
@ -29,7 +29,7 @@ type State {
|
|||
pub opaque type Model {
|
||||
Model(
|
||||
state: State,
|
||||
players: List(#(String, String)),
|
||||
players: List(#(String, #(String, List(#(String, String))))),
|
||||
lobby: #(String, List(User)),
|
||||
registry: GroupRegistry(NotifyClient),
|
||||
handler: Started(Subject(NotifyServer)),
|
||||
|
|
@ -137,7 +137,14 @@ fn view(model: Model) -> Element(Msg) {
|
|||
AskName ->
|
||||
case model.players {
|
||||
[] -> input_new_player(ReceiveName)
|
||||
_ -> view_players(model.players, AcceptName)
|
||||
_ ->
|
||||
view_players(
|
||||
list.map(model.players, fn(player) {
|
||||
let #(id, #(name, _)) = player
|
||||
#(id, name)
|
||||
}),
|
||||
AcceptName,
|
||||
)
|
||||
}
|
||||
NameOk(name) -> {
|
||||
shared.confirm_cells(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue