Skip to content

Commit

Permalink
Merge f2c86a1 into 0c99a95
Browse files Browse the repository at this point in the history
  • Loading branch information
dms1lva committed Mar 15, 2018
2 parents 0c99a95 + f2c86a1 commit 1f51aaf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/controllers/HistoryController.ts
Expand Up @@ -89,16 +89,19 @@ export class HistoryController extends RootComponent {
this.logger.trace('Update history hash');

const hash = '#' + this.hashUtils.encodeValues(values);
this.ignoreNextHashChange = this.window.location.hash != hash;
const hashHasChanged = this.window.location.hash != hash;
this.ignoreNextHashChange = hashHasChanged;

this.logger.trace('ignoreNextHashChange', this.ignoreNextHashChange);
this.logger.trace('initialHashChange', this.initialHashChange);
this.logger.trace('from', this.window.location.hash, 'to', hash);

if (this.initialHashChange) {
this.initialHashChange = false;
this.window.location.replace(hash);
this.logger.trace('History hash modified', hash);
if (hashHasChanged) {
this.window.location.replace(hash);
this.logger.trace('History hash modified', hash);
}
} else if (this.ignoreNextHashChange) {
this.window.location.hash = hash;
this.logger.trace('History hash created', hash);
Expand Down

0 comments on commit 1f51aaf

Please sign in to comment.