mirror of https://github.com/zulip/zulip.git
narrow: Fix incorrect message_view_header title in `with` operator.
Previously, when a link containing the "with" operator in an incorrect narrow is loaded, it used to open the correct view with the wrong title of the message view header. This commit fixes it by re building the message view header title in case the narrow for the "with" operator has changed.
This commit is contained in:
parent
125ef2a7d4
commit
47fad72226
|
@ -1486,7 +1486,9 @@ export class Filter {
|
|||
}
|
||||
|
||||
sorted_term_types(): string[] {
|
||||
if (this._sorted_term_types === undefined) {
|
||||
// We need to rebuild the sorted_term_types if at all our narrow
|
||||
// is updated (through `with` operator).
|
||||
if (this._sorted_term_types === undefined || this.narrow_requires_hash_change) {
|
||||
this._sorted_term_types = this._build_sorted_term_types();
|
||||
}
|
||||
return this._sorted_term_types;
|
||||
|
|
|
@ -666,6 +666,17 @@ export function show(raw_terms, opts) {
|
|||
// filter.try_adjusting_for_moved_with_target, and
|
||||
// should update the URL hash accordingly.
|
||||
update_hash_to_match_filter(filter, "retarget topic location");
|
||||
// Since filter is updated, we need to handle various things
|
||||
// like updating the message view header title, unread banner
|
||||
// based on the updated filter.
|
||||
handle_post_message_list_change(
|
||||
id_info,
|
||||
message_lists.current,
|
||||
opts,
|
||||
select_immediately,
|
||||
select_opts,
|
||||
then_select_offset,
|
||||
);
|
||||
filter.narrow_requires_hash_change = false;
|
||||
}
|
||||
if (!select_immediately) {
|
||||
|
|
Loading…
Reference in New Issue