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 =
model.state
autoState =
model.state.autoComplete
-- Recalculate auto-completion results
matches =
if itemName == "" then
[]
-- For now, merchantLoot *IS* the inventory
results =
model.state.merchantLoot
|> List.filter (\i -> insensitiveContains itemName i.name)
else
-- TODO: For now, merchantLoot *IS* the inventory
model.state.merchantLoot
|> List.filter (\i -> insensitiveContains itemName i.name)
in
{ model
| state =
{ state | autoComplete = results }
}
{ model | state = { state | autoComplete = matches } }
-- Update newItem field and erase other (outdated) values
|> 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 u model =
{- Note: DbUpdates always refer to the active player's loot -}
let
state =
model.state