Merge pull request #3789 from overleaf/bg-fix-root-doc-override

suppress root doc override when in the root doc

GitOrigin-RevId: 3671dece0857b114d0b40cdc2161be0546377985
This commit is contained in:
Brian Gough 2021-03-18 08:39:56 +00:00 committed by Copybot
parent be95516185
commit 0ca6b5921f

View file

@ -719,6 +719,11 @@ App.controller('PdfController', function(
}
function getRootDocOverrideId() {
const rootDocId = $scope.project.rootDoc_id
const currentDocId = ide.editorManager.getCurrentDocId()
if (currentDocId === rootDocId) {
return null // no need to override when in the root doc itself
}
const doc = ide.editorManager.getCurrentDocValue()
if (doc == null) {
return null