diff --git a/web/pdf_history.js b/web/pdf_history.js index cca49c476..0edc0933f 100644 --- a/web/pdf_history.js +++ b/web/pdf_history.js @@ -109,7 +109,7 @@ class PDFHistory { this._currentHash = getCurrentHash(); this._numPositionUpdates = 0; - this._currentUid = this._uid = 0; + this._uid = 0; this._destination = null; this._position = null; @@ -266,7 +266,7 @@ class PDFHistory { let shouldReplace = forceReplace || !this._destination; let newState = { fingerprint: this.fingerprint, - uid: shouldReplace ? this._currentUid : this._uid, + uid: shouldReplace ? this._uid : (this._uid + 1), destination, }; @@ -392,8 +392,7 @@ class PDFHistory { delete destination.temporary; } this._destination = destination; - this._currentUid = uid; - this._uid = this._currentUid + 1; + this._uid = uid; // This should always be reset when `this._destination` is updated. this._numPositionUpdates = 0; } @@ -468,7 +467,7 @@ class PDFHistory { (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('CHROME') && state.chromecomState && !this._isValidState(state))) { // This case corresponds to the user changing the hash of the document. - this._currentUid = this._uid; + this._uid++; let { hash, page, rotation, } = parseCurrentHash(this.linkService); this._pushOrReplaceState({ hash, page, rotation, },