mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
message_list_view: Fix missing bookend when prepending messages.
The logic for inserting bookend when prepending messages was missing. Fixed by inserting the bookend at the correct position. Reproducer: Modify `message_fetch` parameters to only fetch one message per fetch to ensure that each message is prepended. Subscribe to a channel and send a message. Reload. Bookend is absent before the latest message without this commit.
This commit is contained in:
@@ -983,6 +983,11 @@ export class MessageListView {
|
|||||||
update_group_date(second_group, curr_msg_container.msg, prev_msg_container?.msg);
|
update_group_date(second_group, curr_msg_container.msg, prev_msg_container?.msg);
|
||||||
// We could add an action to update the date row, but for now rerender the group.
|
// We could add an action to update the date row, but for now rerender the group.
|
||||||
message_actions.rerender_groups.push(second_group);
|
message_actions.rerender_groups.push(second_group);
|
||||||
|
} else if (second_group.bookend_top) {
|
||||||
|
// We know there was no bookend_top before since we
|
||||||
|
// are adding messages to the top.
|
||||||
|
const rendered_bookend_html = render_bookend(second_group);
|
||||||
|
this.$list.prepend($(rendered_bookend_html));
|
||||||
}
|
}
|
||||||
message_actions.prepend_groups = new_message_groups;
|
message_actions.prepend_groups = new_message_groups;
|
||||||
this._message_groups = [...new_message_groups, ...this._message_groups];
|
this._message_groups = [...new_message_groups, ...this._message_groups];
|
||||||
|
|||||||
Reference in New Issue
Block a user