I have the following doubt, I have a countdown timer, and for example, I click the button, the button becomes invisible and the timer starts, my problem is that when I change the page and return it the button is active and I only want the active button when the timer runs out.
I'm using setTimeout
setTimeout(() => {
var disableButton1 = document.getElementById("startMission1")
var disableButton2 = document.getElementById("startMission2")
var disableButton3 = document.getElementById("startMission3")
disableButton1.style.display='block'
disableButton2.style.display='block'
disableButton3.style.display='block'
disableButton4.style.display='block'
disableButton5.style.display='block'
disableButton6.style.display='block'
div1.style.marginTop= "-20%"
var currentUser = Meteor.user();
var total = (Number(currentUser.profile.hp) + Number(currentUser.profile.attack) + Number(currentUser.profile.luck));
var actualPoints = (Number(currentUser.profile.points))
var totalPoints = (total + actualPoints)
Meteor.users.update({_id: Meteor.userId()},{$set:{"profile.points": totalPoints}})
}, 1200000)