small fixes

This commit is contained in:
2019-11-12 16:07:15 +01:00
parent 13d9378c35
commit ca1ff2c778

View File

@@ -737,18 +737,17 @@ update msg model =
state = state =
model.state model.state
autoState = -- Recalculate auto-completion results
model.state.autoComplete matches =
if itemName == "" then
[]
-- For now, merchantLoot *IS* the inventory else
results = -- TODO: For now, merchantLoot *IS* the inventory
model.state.merchantLoot model.state.merchantLoot
|> List.filter (\i -> insensitiveContains itemName i.name) |> List.filter (\i -> insensitiveContains itemName i.name)
in in
{ model { model | state = { state | autoComplete = matches } }
| state =
{ state | autoComplete = results }
}
-- Update newItem field and erase other (outdated) values -- Update newItem field and erase other (outdated) values
|> update (SetNewItem <| Item 0 itemName 0) |> update (SetNewItem <| Item 0 itemName 0)
@@ -899,12 +898,9 @@ setError error model =
} }
-- DbUpdates always refer to the active player's loot
applyUpdate : Api.Update -> Model -> Model applyUpdate : Api.Update -> Model -> Model
applyUpdate u model = applyUpdate u model =
{- Note: DbUpdates always refer to the active player's loot -}
let let
state = state =
model.state model.state