Skip to content

Commit

Permalink
Remove unused expected_hash variable.
Browse files Browse the repository at this point in the history
We stopped setting this nearly five years ago, as part
of bd9cccf

The big conditional that I removed here should have
always evaluated to false, as I understand the code.
Presumably either the browsers handle # -> '' redirects
better now, or we address this somewhere else in our
codebase.
  • Loading branch information
Steve Howell authored and timabbott committed Dec 4, 2018
1 parent a9391e0 commit 4af1061
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions static/js/hashchange.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ var hashchange = (function () {

var exports = {};

var expected_hash;
var changing_hash = false;

function set_hash(hash) {
Expand Down Expand Up @@ -82,20 +81,6 @@ function activate_home_tab() {

// Returns true if this function performed a narrow
function do_hashchange_normal(from_reload) {
// If window.location.hash changed because our app explicitly
// changed it, then we don't need to do anything.
// (This function only neds to jump into action if it changed
// because e.g. the back button was pressed by the user)
//
// The second case is for handling the fact that some browsers
// automatically convert '#' to '' when you change the hash to '#'.
if (window.location.hash === expected_hash ||
expected_hash !== undefined &&
window.location.hash.replace(/^#/, '') === '' &&
expected_hash.replace(/^#/, '') === '') {
return false;
}

message_viewport.stop_auto_scrolling();

// NB: In Firefox, window.location.hash is URI-decoded.
Expand Down

0 comments on commit 4af1061

Please sign in to comment.