Skip to content

Commit

Permalink
Merge pull request mozilla#14181 from PinRathod/simpleviewer_to_async
Browse files Browse the repository at this point in the history
Converted simpleviewer.js to await/async
  • Loading branch information
Snuffleupagus committed Oct 26, 2021
2 parents 1ab9a6e + 4c463c6 commit 390ddd9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/components/simpleviewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,11 @@ const loadingTask = pdfjsLib.getDocument({
cMapPacked: CMAP_PACKED,
enableXfa: ENABLE_XFA,
});
loadingTask.promise.then(function (pdfDocument) {
(async function () {
const pdfDocument = await loadingTask.promise;
// Document loaded, specifying document for the viewer and
// the (optional) linkService.
pdfViewer.setDocument(pdfDocument);

pdfLinkService.setDocument(pdfDocument, null);
});
})();

0 comments on commit 390ddd9

Please sign in to comment.