mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Wrap recompile response handlers in $applyAsync (#4253)
GitOrigin-RevId: 80e5652b88ba70b3ea1aef2cf24430597574353e
This commit is contained in:
parent
be73463e35
commit
9b9d6f679e
1 changed files with 22 additions and 16 deletions
|
@ -832,12 +832,15 @@ App.controller(
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
const { data } = response
|
const { data } = response
|
||||||
const compileTimeClientE2E = performance.now() - t0
|
const compileTimeClientE2E = performance.now() - t0
|
||||||
|
$scope.$applyAsync(() => {
|
||||||
$scope.pdf.view = 'pdf'
|
$scope.pdf.view = 'pdf'
|
||||||
$scope.pdf.compiling = false
|
$scope.pdf.compiling = false
|
||||||
parseCompileResponse(data, compileTimeClientE2E)
|
parseCompileResponse(data, compileTimeClientE2E)
|
||||||
})
|
})
|
||||||
|
})
|
||||||
.catch(function (response) {
|
.catch(function (response) {
|
||||||
const { status } = response
|
const { status } = response
|
||||||
|
$scope.$applyAsync(() => {
|
||||||
if (status === 429) {
|
if (status === 429) {
|
||||||
$scope.pdf.rateLimited = true
|
$scope.pdf.rateLimited = true
|
||||||
}
|
}
|
||||||
|
@ -851,9 +854,12 @@ App.controller(
|
||||||
$scope.pdf.compileFailed = true
|
$scope.pdf.compileFailed = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
$scope.$applyAsync(() => {
|
||||||
$scope.lastFinishedCompileAt = Date.now()
|
$scope.lastFinishedCompileAt = Date.now()
|
||||||
})
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// This needs to be public.
|
// This needs to be public.
|
||||||
|
|
Loading…
Reference in a new issue