stream links: Use more standard API to go to location.

For stream links inside messages (like "#social") we
now use these functions:

    hashchange.go_to_location:

        We don't need to set href.  Relative paths
        are more standard, and the url is already
        encoded.

    hash_util.by_stream_uri:

        This saves a step in building the URL.
This commit is contained in:
Steve Howell
2018-12-02 18:06:01 +00:00
committed by Tim Abbott
parent 846dfb2fe4
commit bc18eb1d41

View File

@@ -197,7 +197,7 @@ exports.initialize = function () {
// so we re-encode the hash.
var stream = stream_data.get_sub_by_id($(this).attr('data-stream-id'));
if (stream) {
window.location.href = '/#narrow/stream/' + hash_util.encode_stream_name(stream.name);
hashchange.go_to_location(hash_util.by_stream_uri(stream.name));
return;
}
window.location.href = $(this).attr('href');