From 5fa436eb2176b932627da72bdb00c60584e10450 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Wed, 22 Sep 2021 11:01:30 +0300 Subject: [PATCH] Web: Editor: Fixed getting information of difference of file. --- web/ASC.Web.Editor/src/Editor.jsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/web/ASC.Web.Editor/src/Editor.jsx b/web/ASC.Web.Editor/src/Editor.jsx index 17dd5d802df..373b3db3ebb 100644 --- a/web/ASC.Web.Editor/src/Editor.jsx +++ b/web/ASC.Web.Editor/src/Editor.jsx @@ -240,7 +240,7 @@ const Editor = () => { setIsAuthenticated(successAuth); } - const config = await openEdit(fileId, version, doc, view); + config = await openEdit(fileId, version, doc, view); if ( !view && @@ -462,17 +462,17 @@ const Editor = () => { const onSDKRequestHistoryData = async (event) => { var version = event.data; console.log("version", version); - const newConfig = await openEdit(fileId, version, doc); - const prevConfig = await openEdit(fileId, version - 1, doc); - console.log("newConfig", prevConfig); + + const diff = await getEditDiff(fileId, version); + docEditor.setHistoryData({ - //changesUrl: "https://example.com/url-to-changes.zip", - key: newConfig.document.key, + changesUrl: diff.changesUrl, + key: diff.key, previous: { - key: prevConfig.document.key, - url: prevConfig.document.url, + key: diff.previous?.key, + url: diff.previous?.url, }, - url: newConfig.document.url, + url: diff.url, }); }; const onSDKRequestHistoryClose = () => {