Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

hash_util: Use URL base paramater to simplify get_link_hash.

Evy Kassirerded22afc7d7d
diff --git a/web/src/hash_util.ts b/web/src/hash_util.ts
index c6e4d27c49d..3d03716e473 100644
--- a/web/src/hash_util.ts
+++ b/web/src/hash_util.ts
@@ -437,11 +437,8 @@ export function decode_stream_topic_from_url(
}
export function get_link_hash(link: string): string {
- if (link.startsWith("/#narrow/")) {
- return link.slice(1);
- }
try {
- return new URL(link).hash;
+ return new URL(link, window.location.origin).hash;
} catch {
return "";
}