Skip to content

Commit 1e921be

Browse files
authored
fix(pdfjs-preload): removing doc first pages check (#1573)
1 parent 7da55f1 commit 1e921be

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

src/lib/viewers/doc/DocBaseViewer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ class DocBaseViewer extends BaseViewer {
437437
* @return {void}
438438
*/
439439
loadViewerAssets() {
440-
const ASSETS = this.featureEnabled(DOC_FIRST_PAGES_ENABLED) ? [...JS_NO_EXIF, ...EXIF_READER] : JS;
440+
const ASSETS = [...JS_NO_EXIF, ...EXIF_READER];
441441
this.loadAssets(ASSETS, CSS);
442442
this.loadAssets(PRELOAD_JS, []);
443443
}

src/lib/viewers/doc/__tests__/DocBaseViewer-test.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -966,17 +966,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => {
966966
jest.restoreAllMocks();
967967
});
968968

969-
test('should load JS and CSS assets when docFirstPages is disabled', () => {
970-
testDocBase.loadViewerAssets();
971-
expect(testDocBase.loadAssets).toHaveBeenCalledTimes(2);
972-
expect(testDocBase.loadAssets).toHaveBeenNthCalledWith(1, JS, CSS);
973-
expect(testDocBase.loadAssets).toHaveBeenNthCalledWith(2, PRELOAD_JS, []);
974-
});
975-
976-
test('should load JS_NO_EXIF and EXIF_READER assets when docFirstPages is enabled', () => {
977-
testDocBase.options.features = {
978-
'docFirstPages.enabled': true,
979-
};
969+
test('should load PDFJS and EXIF_READER', () => {
980970
testDocBase.loadViewerAssets();
981971
expect(testDocBase.loadAssets).toHaveBeenCalledTimes(2);
982972
expect(testDocBase.loadAssets).toHaveBeenNthCalledWith(1, [...JS_NO_EXIF, ...EXIF_READER], CSS);

0 commit comments

Comments
 (0)