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:
Jonas Jenwald 2021-03-07 16:12:29 +01:00
parent bdde621366
commit bc13932ac1
2 changed files with 4 additions and 7 deletions

View file

@ -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,
});
}
}