Remove unused expected_hash variable.

We stopped setting this nearly five years ago, as part
of bd9cccffce

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.
This commit is contained in:
Steve Howell
2018-12-04 19:59:34 +00:00
committed by Tim Abbott
parent a9391e0499
commit 4af1061974

View File

@@ -3,7 +3,6 @@ var hashchange = (function () {
var exports = {};
var expected_hash;
var changing_hash = false;
function set_hash(hash) {
@@ -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.