mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
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:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user