Skip to content

Commit 5a13001

Browse files
authored
Merge pull request #1070 from afranchuk/master
Avoid an error if `Offset.update()` hasn't been called yet.
2 parents 60ec890 + 5ec63b7 commit 5a13001

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Bugfixes & Improvements
5858
- Disable Postbox submit button on click, enable after response (`#993`_, pkvach)
5959
- Document title parameter and improve error handling for /new API (`#1058`_, pkvach)
6060
- Set reply sorting to always be oldest (`#1035`_, ggtylerr)
61+
- Fix ``Offset.localTime()`` failing if ``Offset.update()`` hasn't been called yet.
6162

6263
.. _#951: https://github.com/posativ/isso/pull/951
6364
.. _#967: https://github.com/posativ/isso/pull/967

isso/js/app/globals.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Offset.prototype.update = function(remoteTime) {
1010

1111
Offset.prototype.localTime = function() {
1212
return new Date((new Date()).getTime() - this.values.reduce(
13-
function(a, b) { return a + b; }) / this.values.length);
13+
function(a, b) { return a + b; }, 0) / this.values.length);
1414
};
1515

1616
var offset = new Offset();

0 commit comments

Comments
 (0)