         @canvases.push(canvas)
 
       @renderPdf()
-    , => @updating = false
+    , => @finishUpdate()
 
   renderPdf: (scrollAfterRender = true) ->
     @centersBetweenPages = []


    onFileChangeCallback =
      _.debounce =>
        @updatePdf() unless @updating
      , 100

    disposables.add @file.onDidChange onFileChangeCallback


    atom.views.getView(atom.workspace).dispatchEvent(new Event('pdf-view:current-page-update'));

  finishUpdate: ->
    @updating = false
    if @fileChanged
      @updatePdf()

  updatePdf: ->
    @updating = true
    @fileChanged = false
    @container.find("canvas").remove()
    @canvases = []

