# How can I disable a component for certain period of time and store it so that if someone reopens application timer do not get reset

**URL:** <https://community.thunkable.com/t/how-can-i-disable-a-component-for-certain-period-of-time-and-store-it-so-that-if-someone-reopens-application-timer-do-not-get-reset/2434970>\
**Category:** Questions about Thunkable X\
**Tags:** beginner\
**Created:** [May 25, 2023, 3:04am UTC](https://community.thunkable.com/t/how-can-i-disable-a-component-for-certain-period-of-time-and-store-it-so-that-if-someone-reopens-application-timer-do-not-get-reset/2434970 "2023-05-25T03:04:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![siddharth.gamer09x](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@siddharth.gamer09x](https://community.thunkable.com/u/siddharth.gamer09x)\
**Post date:** [May 25, 2023, 3:04am UTC](https://community.thunkable.com/t/how-can-i-disable-a-component-for-certain-period-of-time-and-store-it-so-that-if-someone-reopens-application-timer-do-not-get-reset/2434970/1 "2023-05-25T03:04:34Z")

</div>

I am trying for days please someone help me.  
How can I disable a component ( button ) for certain period of time and store it so that it runs in background means when user reopens application. timer do not get reset.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 25, 2023, 4:36am UTC](https://community.thunkable.com/t/how-can-i-disable-a-component-for-certain-period-of-time-and-store-it-so-that-if-someone-reopens-application-timer-do-not-get-reset/2434970/2 "2023-05-25T04:36:40Z")

</div>

You can use the [seconds since 1970] block in the Devices drawer. When you disable the button, set a variable called disableTimestamp to [seconds since 1970]. It will need to be a _stored_ variable so that it gets saved to the device.

Then, when the screen opens, check to see if [seconds since 1970] - disableTimestamp ≥ [amount of time to disable button]. If so, allow enable the button.

---

<div class="post-metadata">

**Author:** ![siddharth.gamer09x](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@siddharth.gamer09x](https://community.thunkable.com/u/siddharth.gamer09x)\
**Post date:** [May 27, 2023, 3:45am UTC](https://community.thunkable.com/t/how-can-i-disable-a-component-for-certain-period-of-time-and-store-it-so-that-if-someone-reopens-application-timer-do-not-get-reset/2434970/3 "2023-05-27T03:45:52Z")

</div>

![IMG_20230527_091327](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/f/ff09fd7d6ee8dbea6f801c391783893a70f729b2.jpeg)

I did this and things are also working but when i press back or I re login the button automatically enables even if I set the timer…what can I do so that buttons work in background or work even if I press back or do something… please help with this

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 27, 2023, 3:53am UTC](https://community.thunkable.com/t/how-can-i-disable-a-component-for-certain-period-of-time-and-store-it-so-that-if-someone-reopens-application-timer-do-not-get-reset/2434970/4 "2023-05-27T03:53:29Z")

</div>

You should not be using the `Timer1's Time in seconds` block. I suggested that you need to check if a value is greater than or equal to the [amount of time to disable button]. So if you want it disabled for an hour, you would check if it’s ≥ 3600 because 60 minutes \* 60 seconds = 3600 seconds.

With this method, you do not need a Timer component at all.

Also, I suggested a _stored_ variable and you instead used an _app_ variable. That’s not correct. Only a stored variable will save the value after the app closes.

---

<div class="post-metadata">

**Author:** ![siddharth.gamer09x](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@siddharth.gamer09x](https://community.thunkable.com/u/siddharth.gamer09x)\
**Post date:** [May 27, 2023, 8:00am UTC](https://community.thunkable.com/t/how-can-i-disable-a-component-for-certain-period-of-time-and-store-it-so-that-if-someone-reopens-application-timer-do-not-get-reset/2434970/5 "2023-05-27T08:00:19Z")

</div>

![Screenshot 2023-05-27 132343](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/2/42661f87934dca950b6c9a4776da8ac9afbae98d.png)

I did as you said things are also working but when i press back and reopens that screen it does not store and it automatically enables the button even when your time period is not over? Please help me fix this.

and i am doing things on live test on device.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 27, 2023, 9:00am UTC](https://community.thunkable.com/t/how-can-i-disable-a-component-for-certain-period-of-time-and-store-it-so-that-if-someone-reopens-application-timer-do-not-get-reset/2434970/6 "2023-05-27T09:00:24Z")

</div>

Okay, so when the screen opens, it’s going to set the button’s “disabled” property to whatever you have it set to as the default. Try adding an else section to the `if` block and have the else section set ad1’s Disabled to true.

Can you share a link to your project?

---

<div class="post-metadata">

**Author:** ![siddharth.gamer09x](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@siddharth.gamer09x](https://community.thunkable.com/u/siddharth.gamer09x)\
**Post date:** [May 27, 2023, 10:39am UTC](https://community.thunkable.com/t/how-can-i-disable-a-component-for-certain-period-of-time-and-store-it-so-that-if-someone-reopens-application-timer-do-not-get-reset/2434970/7 "2023-05-27T10:39:03Z")

</div>

[https://x.thunkable.com/copy/e84594f95238e30eb1c5a13998e82c09](https://x.thunkable.com/copy/e84594f95238e30eb1c5a13998e82c09)

This is link

I did as you said still not working sir.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 27, 2023, 3:39pm UTC](https://community.thunkable.com/t/how-can-i-disable-a-component-for-certain-period-of-time-and-store-it-so-that-if-someone-reopens-application-timer-do-not-get-reset/2434970/8 "2023-05-27T15:39:59Z")

</div>

You didn’t add the change I suggested (an else section) and you’re also testing it with a value of 2. Two seconds might not be enough time to really test this.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 27, 2023, 3:43pm UTC](https://community.thunkable.com/t/how-can-i-disable-a-component-for-certain-period-of-time-and-store-it-so-that-if-someone-reopens-application-timer-do-not-get-reset/2434970/9 "2023-05-27T15:43:25Z")

</div>

Also, any time you use a stored variable, you have to check if it’s null and give it a starting value.

This works for me: [Thunkable](https://x.thunkable.com/copy/921c02cda579ca037435a9b8401e11f2) (see the first screen)

Each time I press Live Test, it displays the elapsed time and enables/disables the button. However, this will not check to see if the time has elapsed _while the app is open_. So you’d need to add a loop to check that.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/1/d12510f8df69ad4a2e87c1f1f67b6474d104fdcd.png)

---

<div class="post-metadata">

**Author:** ![siddharth.gamer09x](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@siddharth.gamer09x](https://community.thunkable.com/u/siddharth.gamer09x)\
**Post date:** [May 27, 2023, 5:08pm UTC](https://community.thunkable.com/t/how-can-i-disable-a-component-for-certain-period-of-time-and-store-it-so-that-if-someone-reopens-application-timer-do-not-get-reset/2434970/10 "2023-05-27T17:08:56Z")

</div>

Sir kudos to you.  
😭🤌🏻 You helped me alot.  
I have no words to express.  
Thankyou so much sir.  
I changed value from 5 to 100 and things worked.

---

<div class="post-metadata">

**Author:** ![siddharth.gamer09x](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@siddharth.gamer09x](https://community.thunkable.com/u/siddharth.gamer09x)\
**Post date:** [May 29, 2023, 7:49am UTC](https://community.thunkable.com/t/how-can-i-disable-a-component-for-certain-period-of-time-and-store-it-so-that-if-someone-reopens-application-timer-do-not-get-reset/2434970/11 "2023-05-29T07:49:11Z")

</div>

Sir sorry to bother you again. But things are working but there is one problem happing I don’t why…so as you did I did the same but the problem is arising that when i click on ad1 buttons disables ok but when i press back and then reopens the same screen then rest of the buttons automatically disabled even when i don’t click on them.

 ![Screenshot_2023-05-29-13-16-38-24_40deb401b9ffe8e1df2f1cc5ba480b12](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/6/c6106f552a2f1d13c77ccf794dba0444db38bfcc.jpeg)  
 ![Screenshot_2023-05-29-13-17-18-30_40deb401b9ffe8e1df2f1cc5ba480b12](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/6/d6d030362f87aca0b37b06e6c11a97b744e72d18.jpeg)

---

<div class="post-metadata">

**Author:** ![siddharth.gamer09x](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@siddharth.gamer09x](https://community.thunkable.com/u/siddharth.gamer09x)\
**Post date:** [May 29, 2023, 7:55am UTC](https://community.thunkable.com/t/how-can-i-disable-a-component-for-certain-period-of-time-and-store-it-so-that-if-someone-reopens-application-timer-do-not-get-reset/2434970/12 "2023-05-29T07:55:30Z")

</div>

![Screenshot_2023-05-29-13-20-25-65_40deb401b9ffe8e1df2f1cc5ba480b12](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/f/bfe663dd255a98ba59d35e397f94b9ec50230b29.jpeg)

Sorry I didn’t attached ad1 blocks

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 29, 2023, 8:28am UTC](https://community.thunkable.com/t/how-can-i-disable-a-component-for-certain-period-of-time-and-store-it-so-that-if-someone-reopens-application-timer-do-not-get-reset/2434970/13 "2023-05-29T08:28:42Z")

</div>

You need to use a different variable for each timestamp. Each button has to have its own.

---

<div class="post-metadata">

**Author:** ![siddharth.gamer09x](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@siddharth.gamer09x](https://community.thunkable.com/u/siddharth.gamer09x)\
**Post date:** [May 29, 2023, 10:10am UTC](https://community.thunkable.com/t/how-can-i-disable-a-component-for-certain-period-of-time-and-store-it-so-that-if-someone-reopens-application-timer-do-not-get-reset/2434970/14 "2023-05-29T10:10:13Z")

</div>

So you are saying there are 5 buttons so I have to make 5 different - stored disable timestamp for each button and use them?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 29, 2023, 5:08pm UTC](https://community.thunkable.com/t/how-can-i-disable-a-component-for-certain-period-of-time-and-store-it-so-that-if-someone-reopens-application-timer-do-not-get-reset/2434970/15 "2023-05-29T17:08:42Z")

</div>

Yes. Because the user will press them at different times so each one should have its own timer, right?

---

<div class="post-metadata">

**Author:** ![siddharth.gamer09x](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@siddharth.gamer09x](https://community.thunkable.com/u/siddharth.gamer09x)\
**Post date:** [May 30, 2023, 1:49am UTC](https://community.thunkable.com/t/how-can-i-disable-a-component-for-certain-period-of-time-and-store-it-so-that-if-someone-reopens-application-timer-do-not-get-reset/2434970/16 "2023-05-30T01:49:10Z")

</div>

Sir

 ![Screenshot_2023-05-30-07-16-50-56_40deb401b9ffe8e1df2f1cc5ba480b12](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/8/d8d3e4b00819decc1675c538bcc9db6f158cb49b.jpeg)

I don’t know why I had 3-4 projects running in my account yesterday means I opened different projects to view. And also there was my project in which I was working. Sir I don’t know but today when I tired to open my project there is no project.I don’t know zero projects are showing…Help me fix this

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 30, 2023, 3:47am UTC](https://community.thunkable.com/t/how-can-i-disable-a-component-for-certain-period-of-time-and-store-it-so-that-if-someone-reopens-application-timer-do-not-get-reset/2434970/17 "2023-05-30T03:47:35Z")

</div>

I’m not going to be able to help you with that but Thunkable Staff should be able to.

Try signing out and signing back in. Is it possible you have two Thunkable accounts?

Also, if you can, post a link to the project here.

---

<div class="post-metadata">

**Author:** ![siddharth.gamer09x](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@siddharth.gamer09x](https://community.thunkable.com/u/siddharth.gamer09x)\
**Post date:** [May 30, 2023, 4:07am UTC](https://community.thunkable.com/t/how-can-i-disable-a-component-for-certain-period-of-time-and-store-it-so-that-if-someone-reopens-application-timer-do-not-get-reset/2434970/18 "2023-05-30T04:07:08Z")

</div>

I have only one account I tired to logout and login but didn’t worked

---

<div class="post-metadata">

**Author:** ![siddharth.gamer09x](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@siddharth.gamer09x](https://community.thunkable.com/u/siddharth.gamer09x)\
**Post date:** [May 30, 2023, 4:16am UTC](https://community.thunkable.com/t/how-can-i-disable-a-component-for-certain-period-of-time-and-store-it-so-that-if-someone-reopens-application-timer-do-not-get-reset/2434970/19 "2023-05-30T04:16:10Z")

</div>

Where can I contact thunkable for help?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 30, 2023, 4:55am UTC](https://community.thunkable.com/t/how-can-i-disable-a-component-for-certain-period-of-time-and-store-it-so-that-if-someone-reopens-application-timer-do-not-get-reset/2434970/20 "2023-05-30T04:55:13Z")

</div>

If you have a Pro account, you can use the chat icon inside a project.

If not, I’m not sure.

[Next page](https://community.thunkable.com/t/how-can-i-disable-a-component-for-certain-period-of-time-and-store-it-so-that-if-someone-reopens-application-timer-do-not-get-reset/2434970.md?page=2)
