Timer Component Session out

I want to disable a “button”, when click on it and enable it back after 30 seconds.
I design it using “wait” command.
But the “button” I mentioned above enable automatically without any time deletion when I go back to the home screen of my app or close the app.

After that I tried it by using timer component. but same thing happened. may be I didn’t set the blocks of time component correctly.

Please help me on this matter. :slight_smile:

2 Likes

Did you try to store timer value as a variable?

Hi @Rumesh, welcome to the Community.

Disabling a button when clicked would look something like this:

You are saying you are having issues? Can you elaborate more on this or explain what happens after the button is clicked?

(edit)

If you are changing between screens:

You can use 2 timers if you are going to be switching through screens. See below how to achieve this:

  • 30 Second Timer settings:

  • Check Timer settings:

  • Add these blocks to the screen in which you want to disable the button:

This works for me when switching between screens.

Let me know how you get on with this :slight_smile:

CHeck this out!

https://x.thunkable.com/projectPage/5df3c3a9786143b77d64902a

when app is closed does the timer still work?

yes!

I checked the timer value by click on a button.

then i see when i go to a another screen and come back the timer get paused. after it’s continued.

how to make a timer still running while I go to a another screen?

Edit

now timer get reset when navigate through screens

Guess I better fix that!

Basically. You save

Seconds since 1970

Then reference how many seconds have passed since you last checked.

Divide by 60.

That’s how many minutes.

2 Likes

thanks and got the idea.

but problem is how to stop timer get reset when navigate through screens.

If a timer isn’t set to loop it stops after the set interval. So if your interval is 30 seconds, you start the timer, it runs for 30 seconds then stops. If you start it again its back to zero, providing count up is disabled.

1 Like

tried but not worked

@jared’s example of using time since 1970 would enable you to have a makeshift timer even when the app is closed. What isn’t working for you?

1 Like

Check this out!

https://x.thunkable.com/copy/fd09ba68db6ece489404cb3c8914b8c4

Just for you @iqbandara11xvit!!

2 Likes

Dear jared,
thank you very much for support on this matter.
I studied your blocks and got a better idea about the concept.
without those blocks i couldn’t solve the problem.

also thank you eoinparkinson. :slight_smile:

2 Likes

Thanks everyone for getting help on this issue.

Both jared’s and iqbandara11xvit’s solutions are worked.

:blush:

1 Like

HI eoinparkinson,

I tried this way. but not worked.

1 Like

Hi @Rumesh,

Apologies about that. Jared’s example should work fine for you.

1 Like

It’s ok.
but I got a better idea about your concept.
thanks.
:smile:

2 Likes