1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Move the Preferences initialization as early as possible

Given that the entire default viewer initialization depends on the preferences being available, try to do this as early as possible.
This commit is contained in:
Jonas Jenwald 2024-07-21 13:42:31 +02:00
parent e92a6a14ff
commit f8aa15aae9

View file

@ -139,7 +139,7 @@ const PDFViewerApplication = {
/** @type {OverlayManager} */
overlayManager: null,
/** @type {Preferences} */
preferences: null,
preferences: new Preferences(),
/** @type {Toolbar} */
toolbar: null,
/** @type {SecondaryToolbar} */
@ -638,7 +638,6 @@ const PDFViewerApplication = {
},
async run(config) {
this.preferences = new Preferences();
await this.initialize(config);
const { appConfig, eventBus } = this;