Content is a type that is not meant to be inspected, but there’s different kinds of content. The content returned by context
is special, because what it represents is… contextual. Not only is it not meant to be inspected, it can’t be inspected (it’s “opaque”), and that includes comparisons. b == [true]
is simply not true, because b
is contextual. [true] == [true]
or [true].text == "true"
work, althought that’s not the common usage of these content values.
So what can you do? The linked post has this example:
Adapted to your situation, that would be
#state("bla").update(true)
#context if state("bla").get() {
[bla is true]
}
Now only the result of the if
, not its condition, is an opaque context value.