diff --git a/services/web/frontend/js/features/pdf-preview/contexts/pdf-preview-context.js b/services/web/frontend/js/features/pdf-preview/contexts/pdf-preview-context.js index afe1db8a96..6147df1d91 100644 --- a/services/web/frontend/js/features/pdf-preview/contexts/pdf-preview-context.js +++ b/services/web/frontend/js/features/pdf-preview/contexts/pdf-preview-context.js @@ -55,7 +55,7 @@ export default function PdfPreviewProvider({ children }) { const [, setLogEntryAnnotations] = useScopeValue('pdf.logEntryAnnotations') // the id of the CLSI server which ran the compile - const [, setClsiServerId] = useScopeValue('ide.clsiServerId') + const [, setClsiServerId] = useScopeValue('pdf.clsiServerId') // whether to display the editor and preview side-by-side or full-width ("flat") const [pdfLayout, setPdfLayout] = useScopeValue('ui.pdfLayout') diff --git a/services/web/frontend/js/ide/pdf/PdfManager.js b/services/web/frontend/js/ide/pdf/PdfManager.js index 5ab0dbf976..d303ddc246 100644 --- a/services/web/frontend/js/ide/pdf/PdfManager.js +++ b/services/web/frontend/js/ide/pdf/PdfManager.js @@ -35,6 +35,8 @@ export default PdfManager = class PdfManager { highlights: [], position: null, lastCompileTimestamp: null, + clsiServerId: null, + compileGroup: null, } } } diff --git a/services/web/frontend/js/ide/pdf/controllers/PdfController.js b/services/web/frontend/js/ide/pdf/controllers/PdfController.js index 7561f54964..b8804a4290 100644 --- a/services/web/frontend/js/ide/pdf/controllers/PdfController.js +++ b/services/web/frontend/js/ide/pdf/controllers/PdfController.js @@ -374,11 +374,11 @@ App.controller( let qs = {} // add a query string parameter for the compile group if (response.compileGroup != null) { - ide.compileGroup = qs.compileGroup = response.compileGroup + $scope.pdf.compileGroup = qs.compileGroup = response.compileGroup } // add a query string parameter for the clsi server id if (response.clsiServerId != null) { - ide.clsiServerId = qs.clsiserverid = response.clsiServerId + $scope.pdf.clsiServerId = qs.clsiserverid = response.clsiServerId } // TODO(das7pad): drop this hack once 2747f0d40af8729304 has landed in clsi @@ -573,8 +573,8 @@ App.controller( method: 'GET', url: buildPdfDownloadUrl(options.pdfDownloadDomain, file.url), params: { - compileGroup: ide.compileGroup, - clsiserverid: ide.clsiServerId, + compileGroup: $scope.pdf.compileGroup, + clsiserverid: $scope.pdf.clsiServerId, }, } return $http(opts) @@ -844,7 +844,7 @@ App.controller( url: `/project/${$scope.project_id}/compile/stop`, method: 'POST', params: { - clsiserverid: ide.clsiServerId, + clsiserverid: $scope.pdf.clsiServerId, }, headers: { 'X-Csrf-Token': window.csrfToken, @@ -865,7 +865,7 @@ App.controller( url: `/project/${$scope.project_id}/output`, method: 'DELETE', params: { - clsiserverid: ide.clsiServerId, + clsiserverid: $scope.pdf.clsiServerId, }, headers: { 'X-Csrf-Token': window.csrfToken, diff --git a/services/web/frontend/js/ide/pdf/controllers/PdfSynctexController.js b/services/web/frontend/js/ide/pdf/controllers/PdfSynctexController.js index 5c41498c48..7c6c0f1fab 100644 --- a/services/web/frontend/js/ide/pdf/controllers/PdfSynctexController.js +++ b/services/web/frontend/js/ide/pdf/controllers/PdfSynctexController.js @@ -107,7 +107,7 @@ App.factory('synctex', function (ide, $http, $q) { file: path, line: row + 1, column, - clsiserverid: ide.clsiServerId, + clsiserverid: ide.$scope.pdf.clsiServerId, }, }) .then(response => { @@ -172,7 +172,7 @@ App.factory('synctex', function (ide, $http, $q) { page: position.page + 1, h: h.toFixed(2), v: v.toFixed(2), - clsiserverid: ide.clsiServerId, + clsiserverid: ide.$scope.pdf.clsiServerId, }, }) .then(response => {