Skip to content

Commit

Permalink
[Clock] Fix incorrect delta calculation (#5286)
Browse files Browse the repository at this point in the history
* Fix !delta check for delta == 0

* Fixed delta comparison
  • Loading branch information
ireneusz-ptak authored and sulkaharo committed Dec 14, 2019
1 parent 04b47f6 commit 51781f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/client/clock-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ client.render = function render (xhr) {
let delta;

xhr.forEach(element => {
if (element.sgv && !rec && !delta) {
if (element.sgv && !rec) {
rec = element;
}
else if (element.sgv && rec && !delta) {
else if (element.sgv && rec && delta==null) {
delta = (rec.sgv - element.sgv)/((rec.date - element.date)/(5*60*1000));
}
});
Expand Down

0 comments on commit 51781f7

Please sign in to comment.