From 07cc9984e12a6a3527b9e45180f5db4d8e01a2a8 Mon Sep 17 00:00:00 2001 From: Kevin F Date: Thu, 5 Oct 2023 20:39:34 +0200 Subject: [PATCH] fix map access #18 --- src/Pages/Page.Dicacle.fs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Pages/Page.Dicacle.fs b/src/Pages/Page.Dicacle.fs index 70c0104..dec2c11 100644 --- a/src/Pages/Page.Dicacle.fs +++ b/src/Pages/Page.Dicacle.fs @@ -219,8 +219,14 @@ let Main() = ] ] Bulma.control.div [ + let isFireball = + let directly = state.Input.ToLower() = "/fireball" + let fromMap = + let containsKey = state.DiceStorage.ContainsKey "fireball" + if containsKey then state.Input = state.DiceStorage.["fireball"] else false + directly || fromMap // alternative, not tested: https://codepen.io/kylewetton/pen/NeRbvz - if state.Input.ToLower() = "/fireball" || state.Input = state.DiceStorage.["fireball"] then + if isFireball then Html.div [ prop.style [style.position.fixedRelativeToWindow] prop.children [