mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-24 08:22:15 +00:00
catch rejected promises in pdfviewer
This commit is contained in:
parent
b4f527b099
commit
a13e78e853
1 changed files with 10 additions and 7 deletions
|
@ -309,7 +309,6 @@ define [
|
|||
scope.loadSuccess = true
|
||||
.catch (error) ->
|
||||
scope.$emit 'pdf:error', error
|
||||
return $q.reject(error)
|
||||
|
||||
elementTimer = null
|
||||
spinnerTimer = null
|
||||
|
@ -373,9 +372,11 @@ define [
|
|||
scope.$emit 'pdf:error:display'
|
||||
return
|
||||
if scope.loadSuccess
|
||||
ctrl.load()
|
||||
# trigger a redraw
|
||||
scope.scale = angular.copy (scope.scale)
|
||||
ctrl.load().then () ->
|
||||
# trigger a redraw
|
||||
scope.scale = angular.copy (scope.scale)
|
||||
.catch (error) ->
|
||||
scope.$emit 'pdf:error:display'
|
||||
else
|
||||
scope.$emit 'pdf:error:display'
|
||||
return
|
||||
|
@ -413,9 +414,11 @@ define [
|
|||
return unless newVal?
|
||||
scope.loadCount = 0; # new pdf, so reset load count
|
||||
scope.loadSuccess = false
|
||||
ctrl.load()
|
||||
# trigger a redraw
|
||||
scope.scale = angular.copy (scope.scale)
|
||||
ctrl.load().then () ->
|
||||
# trigger a redraw
|
||||
scope.scale = angular.copy (scope.scale)
|
||||
.catch (error) ->
|
||||
scope.$emit 'pdf:error', error
|
||||
|
||||
scope.$watch 'scale', (newVal, oldVal) ->
|
||||
# no need to set scale when initialising, done in pdfSrc
|
||||
|
|
Loading…
Reference in a new issue