From 0ca6b5921fca9d272b26541fcfd43b117ac56da0 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Thu, 18 Mar 2021 08:39:56 +0000 Subject: [PATCH] Merge pull request #3789 from overleaf/bg-fix-root-doc-override suppress root doc override when in the root doc GitOrigin-RevId: 3671dece0857b114d0b40cdc2161be0546377985 --- .../web/frontend/js/ide/pdf/controllers/PdfController.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/web/frontend/js/ide/pdf/controllers/PdfController.js b/services/web/frontend/js/ide/pdf/controllers/PdfController.js index 7fa6c6f187..5c9a2bf486 100644 --- a/services/web/frontend/js/ide/pdf/controllers/PdfController.js +++ b/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