Merge pull request #2046 from overleaf/hb-detect-changes-pre-export

Do one compile on toggle to autocompile

GitOrigin-RevId: 21776835c691bec9a1f80a7c0d4e651cc8c59dac
This commit is contained in:
Eric Mc Sween 2019-08-06 11:20:53 -04:00 committed by sharelatex
parent 83495f4559
commit 523b5b2114

View file

@ -131,7 +131,11 @@ define([
let autoCompileInterval = null
const autoCompileIfReady = function() {
if ($scope.pdf.compiling || !$scope.autocompile_enabled) {
if (
$scope.pdf.compiling ||
!$scope.autocompile_enabled ||
!$scope.pdf.uncompiled
) {
return
}
@ -250,7 +254,7 @@ define([
$scope.$watch('autocompile_enabled', function(newValue, oldValue) {
if (newValue != null && oldValue !== newValue) {
if (newValue === true) {
startTryingAutoCompile()
autoCompileIfReady()
}
localStorage(`autocompile_enabled:${$scope.project_id}`, newValue)
return event_tracking.sendMB('autocompile-setting-changed', {