Merge pull request #1150 from ONLYOFFICE/fix/bugfix

Fix fileType in setHistoryData event
This commit is contained in:
Julia Radzhabova 2021-09-02 18:01:05 +03:00 committed by GitHub
commit 88026851e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -202,6 +202,7 @@ define([
urlGetTime = new Date(); urlGetTime = new Date();
var diff = (!opts.data.previous || this.currentChangeId===undefined) ? null : opts.data.changesUrl, // if revision has changes, but serverVersion !== app.buildVersion -> hide revision changes var diff = (!opts.data.previous || this.currentChangeId===undefined) ? null : opts.data.changesUrl, // if revision has changes, but serverVersion !== app.buildVersion -> hide revision changes
url = (!_.isEmpty(diff) && opts.data.previous) ? opts.data.previous.url : opts.data.url, url = (!_.isEmpty(diff) && opts.data.previous) ? opts.data.previous.url : opts.data.url,
fileType = (!_.isEmpty(diff) && opts.data.previous) ? opts.data.previous.fileType : opts.data.fileType,
docId = opts.data.key ? opts.data.key : this.currentDocId, docId = opts.data.key ? opts.data.key : this.currentDocId,
docIdPrev = opts.data.previous && opts.data.previous.key ? opts.data.previous.key : this.currentDocIdPrev, docIdPrev = opts.data.previous && opts.data.previous.key ? opts.data.previous.key : this.currentDocIdPrev,
token = opts.data.token; token = opts.data.token;
@ -217,7 +218,7 @@ define([
rev.set('docIdPrev', docIdPrev, {silent: true}); rev.set('docIdPrev', docIdPrev, {silent: true});
} }
rev.set('token', token, {silent: true}); rev.set('token', token, {silent: true});
opts.data.fileType && rev.set('fileType', opts.data.fileType, {silent: true}); fileType && rev.set('fileType', fileType, {silent: true});
} }
} }
var hist = new Asc.asc_CVersionHistory(); var hist = new Asc.asc_CVersionHistory();