diff --git a/frontend/src/__apps/painel/main.js b/frontend/src/__apps/painel/main.js index 3ebe82563..c00e142a2 100644 --- a/frontend/src/__apps/painel/main.js +++ b/frontend/src/__apps/painel/main.js @@ -196,12 +196,7 @@ const v = new Vue({ // eslint-disable-line this.running = 0 clearInterval(this.started) - this.stopped = setInterval(() => { - this.timeStopped() - }, 100) - }, - timeStopped () { - timeEnd.setMilliseconds(timeEnd.getMilliseconds() + 100) + console.log(time) }, reset: function reset () { this.running = 0 @@ -239,17 +234,20 @@ const v = new Vue({ // eslint-disable-line crono = temp_crono if (time === null) { time = cronometroStart[crono - 1] - console.log(time) timeEnd = new Date() timeEnd.setSeconds(timeEnd.getSeconds() + time) + console.log(timeEnd) } else { - clearInterval(this.stopped) + timeEnd = new Date() + timeEnd.setMinutes(timeEnd.getMinutes() + time.getMinutes()) + timeEnd.setSeconds(timeEnd.getSeconds() + time.getSeconds() + 1) + clearInterval(this.timeStopped) } this.running = crono this.started = setInterval(() => { this.clockRunning(crono) - }, 100) + }, 50) } }, created () { diff --git a/sapl/templates/sessao/painel.html b/sapl/templates/sessao/painel.html index d2b773e1d..b33e6a4b4 100644 --- a/sapl/templates/sessao/painel.html +++ b/sapl/templates/sessao/painel.html @@ -113,7 +113,7 @@ $(function() { $("#relogio").text(h+":"+m+":"+s) var t = setTimeout(function(){ startTime() - },500); + },100); } startTime();