nodejs: fix opening history without changes

This commit is contained in:
Sergey Linnik
2017-09-14 16:07:53 +03:00
parent b3f7e9861f
commit 8e7f7c20e4
2 changed files with 7 additions and 3 deletions

View File

@ -550,14 +550,15 @@ app.get("/editor", function (req, res) {
key: keyVersion,
url: i == countVersion ? url : (docManager.getlocalFileUri(fileName, i, true) + "/prev" + fileUtility.getFileExtension(fileName)),
};
if (i > 1) {
if (i > 1 && docManager.existsSync(docManager.diffPath(fileName, userAddress, i-1))) {
historyD.previous = {
key: historyData[i-2].key,
url: historyData[i-2].url,
};
historyD.changesUrl = docManager.getlocalFileUri(fileName, i-1) + "/diff.zip";
}
historyData.push(historyD);
if (i < countVersion) {