Merge pull request #19503 from Snuffleupagus/web-rm-some-eslint-disable
Remove a few `eslint-disable` statements in the `web/` folder
This commit is contained in:
commit
affce70a09
@ -18,19 +18,13 @@ import { getPdfFilenameFromUrl } from "pdfjs-lib";
|
|||||||
async function docProperties(pdfDocument) {
|
async function docProperties(pdfDocument) {
|
||||||
const url = "",
|
const url = "",
|
||||||
baseUrl = url.split("#", 1)[0];
|
baseUrl = url.split("#", 1)[0];
|
||||||
// eslint-disable-next-line prefer-const
|
const { info, metadata, contentDispositionFilename, contentLength } =
|
||||||
let { info, metadata, contentDispositionFilename, contentLength } =
|
|
||||||
await pdfDocument.getMetadata();
|
await pdfDocument.getMetadata();
|
||||||
|
|
||||||
if (!contentLength) {
|
|
||||||
const { length } = await pdfDocument.getDownloadInfo();
|
|
||||||
contentLength = length;
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...info,
|
...info,
|
||||||
baseURL: baseUrl,
|
baseURL: baseUrl,
|
||||||
filesize: contentLength,
|
filesize: contentLength || (await pdfDocument.getDownloadInfo()).length,
|
||||||
filename: contentDispositionFilename || getPdfFilenameFromUrl(url),
|
filename: contentDispositionFilename || getPdfFilenameFromUrl(url),
|
||||||
metadata: metadata?.getRaw(),
|
metadata: metadata?.getRaw(),
|
||||||
authors: metadata?.get("dc:creator"),
|
authors: metadata?.get("dc:creator"),
|
||||||
|
|||||||
@ -886,9 +886,8 @@ class PDFFindController {
|
|||||||
const { promise, resolve } = Promise.withResolvers();
|
const { promise, resolve } = Promise.withResolvers();
|
||||||
this._extractTextPromises[i] = promise;
|
this._extractTextPromises[i] = promise;
|
||||||
|
|
||||||
// eslint-disable-next-line arrow-body-style
|
deferred = deferred.then(() =>
|
||||||
deferred = deferred.then(() => {
|
this._pdfDocument
|
||||||
return this._pdfDocument
|
|
||||||
.getPage(i + 1)
|
.getPage(i + 1)
|
||||||
.then(pdfPage => pdfPage.getTextContent(textOptions))
|
.then(pdfPage => pdfPage.getTextContent(textOptions))
|
||||||
.then(
|
.then(
|
||||||
@ -921,8 +920,8 @@ class PDFFindController {
|
|||||||
this._hasDiacritics[i] = false;
|
this._hasDiacritics[i] = false;
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
|
)
|
||||||
);
|
);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -260,28 +260,26 @@ window.print = function () {
|
|||||||
ensureOverlay().then(function () {
|
ensureOverlay().then(function () {
|
||||||
overlayManager.closeIfActive(dialog);
|
overlayManager.closeIfActive(dialog);
|
||||||
});
|
});
|
||||||
return; // eslint-disable-line no-unsafe-finally
|
} else {
|
||||||
}
|
|
||||||
const activeServiceOnEntry = activeService;
|
const activeServiceOnEntry = activeService;
|
||||||
activeService
|
activeService
|
||||||
.renderPages()
|
.renderPages()
|
||||||
.then(function () {
|
.then(() => activeServiceOnEntry.performPrint())
|
||||||
return activeServiceOnEntry.performPrint();
|
.catch(() => {
|
||||||
})
|
|
||||||
.catch(function () {
|
|
||||||
// Ignore any error messages.
|
// Ignore any error messages.
|
||||||
})
|
})
|
||||||
.then(function () {
|
.then(() => {
|
||||||
// aborts acts on the "active" print request, so we need to check
|
// aborts acts on the "active" print request, so we need to check
|
||||||
// whether the print request (activeServiceOnEntry) is still active.
|
// whether the print request (activeServiceOnEntry) is still active.
|
||||||
// Without the check, an unrelated print request (created after aborting
|
// Without the check, an unrelated print request (created after
|
||||||
// this print request while the pages were being generated) would be
|
// aborting this print request while the pages were being generated)
|
||||||
// aborted.
|
// would be aborted.
|
||||||
if (activeServiceOnEntry.active) {
|
if (activeServiceOnEntry.active) {
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function dispatchEvent(eventType) {
|
function dispatchEvent(eventType) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user