mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Further ensure that PDFFindController._requestMatchesCount
won't return broken data (PR 10052 follow-up)
This prevents the findbar from intermittently displaying `0 of {number} matches`, which *could* theoretically happen for large and/or slow loading documents.
This commit is contained in:
parent
fafd8819bc
commit
be7fdf148c
1 changed files with 1 additions and 1 deletions
|
@ -510,7 +510,7 @@ class PDFFindController {
|
||||||
// When searching starts, this method may be called before the `pageMatches`
|
// When searching starts, this method may be called before the `pageMatches`
|
||||||
// have been counted (in `_calculateMatch`). Ensure that the UI won't show
|
// have been counted (in `_calculateMatch`). Ensure that the UI won't show
|
||||||
// temporarily broken state when the active find result doesn't make sense.
|
// temporarily broken state when the active find result doesn't make sense.
|
||||||
if (current > total) {
|
if (current < 1 || current > total) {
|
||||||
current = total = 0;
|
current = total = 0;
|
||||||
}
|
}
|
||||||
return { current, total, };
|
return { current, total, };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue