Browse Source

Remove the `this._currentUid` property from `PDFHistory`, since it's no longer needed

Commit 938dffb06b, in PR 8885, removed the only actual usage of `this._currentUid` and it can thus be removed.
Jonas Jenwald 8 years ago
parent
commit
04d4faefc4
  1. 9
      web/pdf_history.js

9
web/pdf_history.js

@ -109,7 +109,7 @@ class PDFHistory {
this._currentHash = getCurrentHash(); this._currentHash = getCurrentHash();
this._numPositionUpdates = 0; this._numPositionUpdates = 0;
this._currentUid = this._uid = 0; this._uid = 0;
this._destination = null; this._destination = null;
this._position = null; this._position = null;
@ -266,7 +266,7 @@ class PDFHistory {
let shouldReplace = forceReplace || !this._destination; let shouldReplace = forceReplace || !this._destination;
let newState = { let newState = {
fingerprint: this.fingerprint, fingerprint: this.fingerprint,
uid: shouldReplace ? this._currentUid : this._uid, uid: shouldReplace ? this._uid : (this._uid + 1),
destination, destination,
}; };
@ -392,8 +392,7 @@ class PDFHistory {
delete destination.temporary; delete destination.temporary;
} }
this._destination = destination; this._destination = destination;
this._currentUid = uid; this._uid = uid;
this._uid = this._currentUid + 1;
// 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;
} }
@ -468,7 +467,7 @@ class PDFHistory {
(typeof PDFJSDev !== 'undefined' && PDFJSDev.test('CHROME') && (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('CHROME') &&
state.chromecomState && !this._isValidState(state))) { state.chromecomState && !this._isValidState(state))) {
// This case corresponds to the user changing the hash of the document. // 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); let { hash, page, rotation, } = parseCurrentHash(this.linkService);
this._pushOrReplaceState({ hash, page, rotation, }, this._pushOrReplaceState({ hash, page, rotation, },

Loading…
Cancel
Save