git.haldean.org sousvide / 0356836
Fix timer implementation, and make noise work. Will Haldean Brown 8 years ago
3 changed file(s) with 5 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
Binary diff not shown
103103 timerElem.innerHTML = ''
104104 for (var i = 0; i < data.length; i++) {
105105 timer = data[i]
106 console.log(timer)
107 if (timer.Expired) {
108 timerAudio.play()
109 }
106110 timerElem.appendChild(makeTimer(timer));
107111 }
108112 }
135139
136140 timerElem = document.getElementById('timers')
137141 timerAudio = document.getElementById('timernoise')
138 timerAudio.play()
139142 getTimerData()
140143 })
2626 func StartTimerUpdateLoop() {
2727 for _ = range time.Tick(time.Second) {
2828 for _, t := range timers {
29 t.TimeRemaining = time.Now().Sub(t.ExpiresAt)
29 t.TimeRemaining = t.ExpiresAt.Sub(time.Now())
3030 t.Expired = t.TimeRemaining < 0
3131 }
3232 }