mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
topics: Change topic links of left sidebar to use new permalinks.
This commit updates the topic links obtained from clicking the topics in the left sidebar, recent view and inbox, and those obtained from "Copy link to topic" to use the new topic permalinks. Fixes part of #21505.
This commit is contained in:
@@ -57,13 +57,22 @@ export function by_stream_url(
|
||||
return `#narrow/channel/${encode_stream_id(stream_id, maybe_get_stream_name)}`;
|
||||
}
|
||||
|
||||
// The message_id parameter is used to obtain topic permalinks,
|
||||
// by using it in a `with` operator.
|
||||
export function by_stream_topic_url(
|
||||
stream_id: number,
|
||||
topic: string,
|
||||
maybe_get_stream_name: MaybeGetStreamName,
|
||||
message_id?: number,
|
||||
): string {
|
||||
if (message_id === undefined) {
|
||||
return `#narrow/channel/${encode_stream_id(
|
||||
stream_id,
|
||||
maybe_get_stream_name,
|
||||
)}/topic/${encodeHashComponent(topic)}`;
|
||||
}
|
||||
return `#narrow/channel/${encode_stream_id(
|
||||
stream_id,
|
||||
maybe_get_stream_name,
|
||||
)}/topic/${encodeHashComponent(topic)}`;
|
||||
)}/topic/${encodeHashComponent(topic)}/with/${message_id}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user