Fix: Wrong time used for calculation
This commit is contained in:
parent
6cd1b574c2
commit
09d72ce3a7
1 changed files with 1 additions and 1 deletions
|
@ -29,7 +29,7 @@ document.addEventListener('alpine:init' , () => {
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
if(!this.currentData) return;
|
if(!this.currentData) return;
|
||||||
|
|
||||||
const passedSeconds = parseInt(((Date.now()-this.timeOffsetToServer) / 1000) - this.currentData.startedAt);
|
const passedSeconds = parseInt(((performance.now()-this.timeOffsetToServer) / 1000) - this.currentData.startedAt);
|
||||||
let remaningSeconds;
|
let remaningSeconds;
|
||||||
if(this.currentData.repeatEnabled) {
|
if(this.currentData.repeatEnabled) {
|
||||||
remaningSeconds = parseInt(this.currentData.time * 60 - (passedSeconds % (this.currentData.time * 60)));
|
remaningSeconds = parseInt(this.currentData.time * 60 - (passedSeconds % (this.currentData.time * 60)));
|
||||||
|
|
Loading…
Reference in a new issue