small fixes
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user