I want to implement some sort of double verification on one feature of my app.
To do this, I want to use a button that has different states. Here is what I need :
default, button text is “A”
once clicked, button text is “B”
once clicked more than 20 seconds ago, button text is “C”
I am able to do step 1 and 2 with no issue. How do I do the step 3 in the above?
I’ve tried setting a custom_state (CS) of type date on my button, and used it in the button conditionnal tab. With something like : “CS is not empty and CS+20seconds > current_date”
But it won’t trigger. It seems like the conditions are checked only once when there is an action on the button, and not later on.
For my understanding, is the behavior I am experiencing with dates to be expected? What is the general lesson to remember : conditions are not checked temporarily?
Yes, it is… Date objects are static, so you can’t do real-time checks against the current date/time (the current date/time is a static value, set at the moment it was defined).
If you need to check a date against the current date/time in real time, you’ll need to update the value of the current date time every second (or however frequently you need for your use-case).