diff --git a/apps/common/main/lib/controller/History.js b/apps/common/main/lib/controller/History.js index f01eb8f7e..18640494f 100644 --- a/apps/common/main/lib/controller/History.js +++ b/apps/common/main/lib/controller/History.js @@ -164,14 +164,9 @@ define([ var rev, revisions = historyStore.findRevisions(data.version), urlGetTime = new Date(); var diff = opts.data.changesUrl, - url, docId; - if (opts.data.current && opts.data.previous) { - url = _.isEmpty(diff) ? opts.data.current.url : opts.data.previous.url; - docId = _.isEmpty(diff) ? opts.data.current.key : opts.data.previous.key; - } else { - url = opts.data.url; - docId = _.isEmpty(diff) ? this.currentDocId : this.currentDocIdPrev; - } + url = (!_.isEmpty(diff) && opts.data.previous) ? opts.data.previous.url : opts.data.url, + docId = opts.data.key ? opts.data.key : this.currentDocId, + docIdPrev = opts.data.previous && opts.data.previous.key ? opts.data.previous.key : this.currentDocIdPrev; if (revisions && revisions.length>0) { for(var i=0; i