Move updating of this._maxUid
into PDFHistory._updateInternalState
There's no compelling reason to update this property *manually* in multiple places, since that's error-prone with any future code changes, given that `_updateInternalState` is always called just before anyway.
This commit is contained in:
parent
295716f496
commit
b302fd3a6e
@ -143,9 +143,6 @@ class PDFHistory {
|
|||||||
state.uid,
|
state.uid,
|
||||||
/* removeTemporary = */ true
|
/* removeTemporary = */ true
|
||||||
);
|
);
|
||||||
if (this._uid > this._maxUid) {
|
|
||||||
this._maxUid = this._uid;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (destination.rotation !== undefined) {
|
if (destination.rotation !== undefined) {
|
||||||
this._initialRotation = destination.rotation;
|
this._initialRotation = destination.rotation;
|
||||||
@ -410,7 +407,6 @@ class PDFHistory {
|
|||||||
if (shouldReplace) {
|
if (shouldReplace) {
|
||||||
window.history.replaceState(newState, "", newUrl);
|
window.history.replaceState(newState, "", newUrl);
|
||||||
} else {
|
} else {
|
||||||
this._maxUid = this._uid;
|
|
||||||
window.history.pushState(newState, "", newUrl);
|
window.history.pushState(newState, "", newUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -534,6 +530,7 @@ class PDFHistory {
|
|||||||
}
|
}
|
||||||
this._destination = destination;
|
this._destination = destination;
|
||||||
this._uid = uid;
|
this._uid = uid;
|
||||||
|
this._maxUid = Math.max(this._maxUid, uid);
|
||||||
// This should always be reset when `this._destination` is updated.
|
// This should always be reset when `this._destination` is updated.
|
||||||
this._numPositionUpdates = 0;
|
this._numPositionUpdates = 0;
|
||||||
}
|
}
|
||||||
@ -688,9 +685,6 @@ class PDFHistory {
|
|||||||
state.uid,
|
state.uid,
|
||||||
/* removeTemporary = */ true
|
/* removeTemporary = */ true
|
||||||
);
|
);
|
||||||
if (this._uid > this._maxUid) {
|
|
||||||
this._maxUid = this._uid;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isValidRotation(destination.rotation)) {
|
if (isValidRotation(destination.rotation)) {
|
||||||
this.linkService.rotation = destination.rotation;
|
this.linkService.rotation = destination.rotation;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user