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.

message_view: Fix scroll jumps to top when user sends a message.

Aman Agrawale5ca15367333
diff --git a/web/src/message_view.ts b/web/src/message_view.ts
index d2bfde261aa..07ca65b6514 100644
--- a/web/src/message_view.ts
+++ b/web/src/message_view.ts
@@ -820,13 +820,18 @@ export let show = (raw_terms: NarrowTerm[], show_opts: ShowMessageViewOpts): voi
) {
// We convert the current narrow into a `near` narrow so that
// user doesn't accidentally mark msgs read which they haven't seen.
- const terms = [
+ let terms = [
...msg_list.data.filter.terms(),
{
operator: "near",
operand: current_selected_id.toString(),
},
];
+ assert(msg_list.data.filter.is_conversation_view());
+ // Using both /with/ and /near/ operators in a single view doesn't
+ // make sense, and checks like is_conversation_view_with_near do not
+ // handle that combination correctly.
+ terms = terms.filter((term) => term.operator !== "with");
const opts = {
trigger: "old_unreads_missing",
};