hashchange: Add hashchange.update_browser_history().

This helps us encapsulate the situation where we don't
want to trigger hashchanged(), without having to do it
within sub.js with prevent_once().
This commit is contained in:
Steve Howell
2018-12-01 19:15:50 +00:00
committed by Tim Abbott
parent 212ee015d4
commit 84d0b541e3
3 changed files with 27 additions and 17 deletions

View File

@@ -4,9 +4,9 @@ var exports = {};
function setup_subscriptions_stream_hash(sub) {
var id = sub.stream_id;
subs.change_state.prevent_once();
window.location.hash = "#streams" + "/" + id + "/" + hash_util.encodeHashComponent(sub.name);
var hash = "#streams" + "/" + id + "/" + hash_util.encodeHashComponent(sub.name);
hashchange.update_browser_history(hash);
}
function settings_for_sub(sub) {