1π
β
In your reset
method,
You need to pass id
as parameter in the start method.
So your start method should look like
start: function(id) {
const client=this.projectSelecter(id);
console.log("ID: ", id);
console.log("Client: ", client);
console.log("Client running property: ", client.running);
//if (client.running) return;
if (client.timeBegan === null) {
this.reset(id); //passing `id` to reset method
client.timeBegan = new Date();
}
if (client.timeStopped !== null) {
client.stoppedDuration += new Date() - client.timeStopped;
}
client.isStarted=!client.isStarted;
client.started = setInterval(this.clockRunning, 10);
client.running = true;
},
π€Helping hand
Source:stackexchange.com