diff --git a/src/Document.jsx b/src/Document.jsx index 86422c797..ebd60f440 100644 --- a/src/Document.jsx +++ b/src/Document.jsx @@ -14,6 +14,7 @@ import Message from './Message'; import LinkService from './LinkService'; import PasswordResponses from './PasswordResponses'; +import eventBus from './eventBus'; import { cancelRunningTask, @@ -60,7 +61,7 @@ export default class Document extends PureComponent { }, }; - linkService = new LinkService(); + linkService = new LinkService({ eventBus }); componentDidMount() { this.loadDocument(); diff --git a/src/Page/AnnotationLayer.spec.jsx b/src/Page/AnnotationLayer.spec.jsx index 73604258b..156d13410 100644 --- a/src/Page/AnnotationLayer.spec.jsx +++ b/src/Page/AnnotationLayer.spec.jsx @@ -11,13 +11,14 @@ import failingPage from '../../__mocks__/_failing_page'; import { loadPDF, makeAsyncCallback, muteConsole, restoreConsole, } from '../../test-utils'; +import eventBus from '../eventBus'; const pdfFile = loadPDF('./__mocks__/_pdf.pdf'); /* eslint-disable comma-dangle */ describe('AnnotationLayer', () => { - const linkService = new LinkService(); + const linkService = new LinkService({ eventBus }); // Loaded page let page; diff --git a/src/eventBus.js b/src/eventBus.js new file mode 100644 index 000000000..1163b0f52 --- /dev/null +++ b/src/eventBus.js @@ -0,0 +1,3 @@ +import { EventBus } from 'pdfjs-dist/lib/web/ui_utils'; + +export default new EventBus();