mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Use more optional chaining in the web/
-folder (PR 12961 follow-up)
I overlooked these cases previously, but there's no reason why optional chaining (and nullish coalescing) cannot be used here as well.
This commit is contained in:
parent
bdde621366
commit
bc13932ac1
2 changed files with 4 additions and 7 deletions
|
@ -771,7 +771,7 @@ class PDFFindController {
|
|||
total = this._matchesCountTotal;
|
||||
if (matchIdx !== -1) {
|
||||
for (let i = 0; i < pageIdx; i++) {
|
||||
current += (this._pageMatches[i] && this._pageMatches[i].length) || 0;
|
||||
current += this._pageMatches[i]?.length || 0;
|
||||
}
|
||||
current += matchIdx + 1;
|
||||
}
|
||||
|
@ -797,7 +797,7 @@ class PDFFindController {
|
|||
state,
|
||||
previous,
|
||||
matchesCount: this._requestMatchesCount(),
|
||||
rawQuery: this._state ? this._state.query : null,
|
||||
rawQuery: this._state?.query ?? null,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue