Open hboon opened 2 months ago
@hboon I've added full support for the conditionals using the implementation from AW iOS, so this is likely fixed.
What was the purpose of loading this attribute before a card is opened? Did you want to display this value somewhere else in the UI?
Maybe we could add a preload XML attribute onto ts:attribute that tells the engine to reload attributes where preload="true".
What was the purpose of loading this attribute before a card is opened? Did you want to display this value somewhere else in the UI?
@micwallace it's so that when we click on the "i"/Information button the attribute value is available. Without the selection hack, the value isn't available until a card using it is displayed.
Maybe we could add a preload XML attribute onto ts:attribute that tells the engine to reload attributes where preload="true".
Yeah, that would be useful.
I was adding a dummy selection so it can be used to trigger early-loading that attribute (
points
). So I wrote this:But the expression parsing code at https://github.com/SmartTokenLabs/tokenscript-engine/blob/0db404a54c692c2bafe7bdbc0beb97f2d376764f/javascript/engine-js/src/tokenScript/selection/SelectionFilter.ts#L19 doesn't handle negative numbers on the RHS.
It'll assign an empty string to
conditionValue
.It's a
uint
though, so I'm not sure we'll ever have negative numbers, or will we?