Skip to content

Commit

Permalink
fix map access #18
Browse files Browse the repository at this point in the history
  • Loading branch information
Freymaurer committed Oct 5, 2023
1 parent df7fb9a commit 07cc998
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Pages/Page.Dicacle.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
Expand Down

0 comments on commit 07cc998

Please sign in to comment.