Merge pull request #18393 from Snuffleupagus/mustBeViewedWhenEditing-params

Check the relevant parameters inside of the `mustBeViewedWhenEditing` method
This commit is contained in:
Tim van der Meij 2024-07-05 15:33:45 +02:00 committed by GitHub
commit ccb141e211
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 4 deletions

View File

@ -777,8 +777,8 @@ class Annotation {
return this.printable; return this.printable;
} }
mustBeViewedWhenEditing() { mustBeViewedWhenEditing(isEditing, modifiedIds = null) {
return !this.data.isEditable; return isEditing ? !this.data.isEditable : !modifiedIds?.has(this.data.id);
} }
/** /**

View File

@ -582,8 +582,7 @@ class Page {
intentAny || intentAny ||
(intentDisplay && (intentDisplay &&
annotation.mustBeViewed(annotationStorage, renderForms) && annotation.mustBeViewed(annotationStorage, renderForms) &&
((isEditing && annotation.mustBeViewedWhenEditing()) || annotation.mustBeViewedWhenEditing(isEditing, modifiedIds)) ||
(!isEditing && !modifiedIds?.has(annotation.data.id)))) ||
(intentPrint && annotation.mustBePrinted(annotationStorage)) (intentPrint && annotation.mustBePrinted(annotationStorage))
) { ) {
opListPromises.push( opListPromises.push(