fix inventory local storage

This commit is contained in:
joneugster
2023-10-13 15:51:00 +02:00
parent 6970f10e30
commit 04038a32c8
3 changed files with 10 additions and 3 deletions
+3 -2
View File
@@ -50,6 +50,7 @@ structure LevelInfo where
descrText : Option String := none
descrFormat : String := ""
lemmaTab : Option String
displayName : Option String
statementName : Option String
template : Option String
deriving ToJson, FromJson
@@ -165,7 +166,8 @@ partial def handleServerEvent (ev : ServerEvent) : GameServerM Bool := do
match lvl.lemmas.tiles.find? (·.new) with
| some tile => tile.category
| none => none
statementName := match lvl.statementName with
statementName := lvl.statementName.toString
displayName := match lvl.statementName with
| .anonymous => none
| name => match (inventoryExt.getState env).find?
(fun x => x.name == name && x.type == .Lemma) with
@@ -194,7 +196,6 @@ partial def handleServerEvent (ev : ServerEvent) : GameServerM Bool := do
-- return true
| Message.request id "loadDoc" params =>
let p ← parseParams LoadDocParams (toJson params)
let s ← get
let c ← read
let some doc ← getInventoryItem? p.name p.type
| do