puts group chest almost back up

This commit is contained in:
2019-12-01 22:03:08 +01:00
parent 09bd6560cc
commit ecb0cc59a8
6 changed files with 253 additions and 65 deletions

View File

@@ -300,8 +300,23 @@ update msg model =
( Player (PlayerConfig session (Add Chest.initCreate)), Cmd.none )
IntoView ->
-- TODO: add the necessary test on group/player
( Player (PlayerConfig session (PlayerChest Chest.init)), Cmd.none )
let
userChest =
case Session.user session of
Session.Player player _ _ ->
if player.id == 0 then
GroupChest
else
PlayerChest
-- TODO: this seems not right
-- there should be a better way
-- to handle this
_ ->
PlayerChest
in
( Player (PlayerConfig session (userChest Chest.init)), Cmd.none )
_ ->
( model, Cmd.none )