Fix spreadsheet issues

pull/1/head
yflory 5 years ago
parent ee291bc0c9
commit 5e9da3f652

@ -228,7 +228,9 @@ define([
var hashes = old ? oldHashes : content.hashes; var hashes = old ? oldHashes : content.hashes;
if (!hashes || !Object.keys(hashes).length) { return {}; } if (!hashes || !Object.keys(hashes).length) { return {}; }
i = i || 0; i = i || 0;
var idx = Object.keys(hashes).map(Number).sort(); var idx = Object.keys(hashes).map(Number).sort(function (a, b) {
return a-b;
});
var lastIndex = idx[idx.length - 1 - i]; var lastIndex = idx[idx.length - 1 - i];
var last = JSON.parse(JSON.stringify(hashes[lastIndex])); var last = JSON.parse(JSON.stringify(hashes[lastIndex]));
return last; return last;

Loading…
Cancel
Save