Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit

Permalink
fix: set loading to false on error. Fixes #72
Browse files Browse the repository at this point in the history
  • Loading branch information
arkokoley committed Aug 1, 2021
1 parent b26c12f commit f17c532
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
7 changes: 5 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
"worker-loader": "^3.0.1"
},
"peerDependencies": {
"vue": "^2.6.11",
"pdfjs-dist": "2.5.207"
"pdfjs-dist": "2.5.207",
"vue": "^2.6.11"
},
"engines": {
"node": ">=10"
Expand Down
13 changes: 9 additions & 4 deletions src/Pdfvuer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
}
export default {
createLoadingTask: createLoadingTask,
components: {
resizeSensor
},
Expand Down Expand Up @@ -162,9 +163,6 @@
textLayerFactory: textLayer,
annotationLayerFactory: annotationLayer,
});
self.loading = false;
self.$emit('loading', false);
// Associates the actual page with the view, and drawing it
self.pdfViewer.setPdfPage(pdfPage);
// Set up a scrollPageIntoView function for our links
Expand All @@ -178,7 +176,14 @@
self.pdfLinkService.setViewer(viewer);
self.pdfFindController.setDocument(self.pdf);
self.drawScaled(self.scale);
}).catch(err => self.$emit('error', err))
self.loading = false;
self.$emit('loading', false);
}).catch(err => {
self.$emit('error', err)
self.loading = false
self.$emit('loading', false);
})
},
beforeDestroy() {
var self = this;
Expand Down

0 comments on commit f17c532

Please sign in to comment.