diff --git a/web/documentserver-example/csharp-mvc/WebEditor.ashx.cs b/web/documentserver-example/csharp-mvc/WebEditor.ashx.cs index e6dbb409..79075368 100644 --- a/web/documentserver-example/csharp-mvc/WebEditor.ashx.cs +++ b/web/documentserver-example/csharp-mvc/WebEditor.ashx.cs @@ -990,7 +990,7 @@ namespace OnlineEditorsExampleMVC var changes = jss.Deserialize>(File.ReadAllText(changesPath)); var changesArray = (ArrayList)changes["changes"]; var change = changesArray.Count > 0 - ? (Dictionary)changesArray[0] + ? (Dictionary)changesArray[changesArray.Count - 1] : new Dictionary(); // write information about changes to the object diff --git a/web/documentserver-example/csharp/WebEditor.ashx.cs b/web/documentserver-example/csharp/WebEditor.ashx.cs index 3fa3b69c..be5a5794 100644 --- a/web/documentserver-example/csharp/WebEditor.ashx.cs +++ b/web/documentserver-example/csharp/WebEditor.ashx.cs @@ -778,7 +778,7 @@ namespace OnlineEditorsExample var changes = jss.Deserialize>(File.ReadAllText(changesPath)); var changesArray = (ArrayList)changes["changes"]; var change = changesArray.Count > 0 - ? (Dictionary)changesArray[0] + ? (Dictionary)changesArray[changesArray.Count - 1] : new Dictionary(); // write information about changes to the object diff --git a/web/documentserver-example/nodejs/helpers/docManager.js b/web/documentserver-example/nodejs/helpers/docManager.js index a9a8b76d..237e9796 100644 --- a/web/documentserver-example/nodejs/helpers/docManager.js +++ b/web/documentserver-example/nodejs/helpers/docManager.js @@ -533,7 +533,7 @@ DocManager.prototype.getHistory = function getHistory(fileName, content, keyVers let createdFromJson = null; if (fileContent) { // if content is defined if (fileContent.changes && fileContent.changes.length) { // and there are some modifications in the content - [contentJson] = fileContent.changes; // write these modifications to the json content + contentJson = fileContent.changes[fileContent.changes.length - 1]; // write these modifications to the json content } else if (fileContent.length) { [contentJson] = fileContent; // otherwise, write original content to the json content oldVersion = true; // and note that this is an old version