use whenLet instead of case

This commit is contained in:
2022-06-19 23:41:48 +00:00
parent 9ee6e879d9
commit 42f20330ba

View File

@@ -7,9 +7,8 @@
[&mut :Bool selected false] [&mut :Bool selected false]
(let [images (readComponent e Images)] (let [images (readComponent e Images)]
(case (dictGet (readComponent e Positions) positionKey) (whenLet [(objectWith x y z) (dictGet (readComponent e Positions) positionKey)]
((object x x y y z z) (super x y))
(super x y)))
(.onComplete (BitmapData.loadFromFile (joinPath archive.archiveDir "files" (nth images.imageFiles images.pinnedImageIndex))) (.onComplete (BitmapData.loadFromFile (joinPath archive.archiveDir "files" (nth images.imageFiles images.pinnedImageIndex)))
->bitmapData { ->bitmapData {
(loadGraphic bitmapData) (loadGraphic bitmapData)