I don't want the countdown to be reset when changing the screen, what to do?

create posts with a countdown, and when the account is finished, delete the post. so I try to do it and every time I change the window the countdown resets, and I want it to continue without resetting again

Hi @Elbordo ,

I think this component is interesting for you,

And another alternative, if I may suggest, you can add additional property for expiration date, and use them with countdown too, but 0 seconds, and action to delete whenever the expiration date pass current time. Put this at entry screen and view screen, so expired post will not be seen.

1 Like

Hello Yongki, how would the second alternative be? Could you help me a little.

Try this first and let me know the result.

Hi @Elbordo,

Let me expand reply by @Yongki a bit.

If your post needs to disappear after some time - you can set an expiration date for a post, and use it for future actions. For example:

  • add a DateTime property to Posts collection, call it ExpirationTime
  • upon creating a post, set this property to CurrentTime+0.5 (this will mean that the post will exist for 12 hours)
  • use an expression: (Current Post->ExpirationTime - CurrentTime)*86400 in Countdown timer component (number to count down from).
  • result: each time you will enter this screen, countdown will start counting based on number of seconds left before expiration
  • you will also need to expire the post itself. For this, add a on-screen-enter action to “expire” the post (mark expired, delete is not a very good idea). Make this action conditional, so it happens only when Current Post → Expiration date is before Current Time.

Best regards, Victor.

3 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.