mirror of
https://github.com/zulip/zulip.git
synced 2026-07-03 21:10:12 +08:00
ui_init: Don't add with operator if topic has no messages.
Left sidebar can contain links empty topics. If user clicks on them, we add `with` operator to the narrow if the topic is empty. Reproducer: * Click on a topic in left sidebar. * Delete all the messages in the topic. * Click on the topic again.
This commit is contained in:
parent
674d26a66b
commit
ffeb027b4c
@ -668,16 +668,16 @@ export function initialize_everything(state_data) {
|
||||
topic,
|
||||
);
|
||||
|
||||
assert(latest_msg_id !== undefined);
|
||||
const narrow = [
|
||||
{operator: "channel", operand: sub.stream_id.toString()},
|
||||
{operator: "topic", operand: topic},
|
||||
];
|
||||
|
||||
message_view.show(
|
||||
[
|
||||
{operator: "channel", operand: sub.stream_id.toString()},
|
||||
{operator: "topic", operand: topic},
|
||||
{operator: "with", operand: latest_msg_id},
|
||||
],
|
||||
{trigger: "sidebar"},
|
||||
);
|
||||
if (latest_msg_id !== undefined) {
|
||||
narrow.push({operator: "with", operand: latest_msg_id});
|
||||
}
|
||||
|
||||
message_view.show(narrow, {trigger: "sidebar"});
|
||||
},
|
||||
});
|
||||
drafts.initialize_ui();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user