Просмотр исходного кода

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

suppress root doc override when in the root doc

GitOrigin-RevId: 3671dece0857b114d0b40cdc2161be0546377985
Brian Gough 5 лет назад
Родитель
Сommit
0ca6b5921f
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      services/web/frontend/js/ide/pdf/controllers/PdfController.js

+ 5 - 0
services/web/frontend/js/ide/pdf/controllers/PdfController.js

@@ -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