Split selecting a message and hiding the empty narrow message

We should hide the empty narrow message message whenever the narrow is
not empty, but we should only select a message if non are currently
selected.

(imported from commit 22f6b0827dc84ed587a83b5d713b12c1d5d4c0a0)
This commit is contained in:
Jason Michalski
2014-03-04 16:39:34 -05:00
parent eabd9341b6
commit 09dfc9a89b

View File

@@ -73,12 +73,15 @@ MessageList.prototype = {
self.append(bottom_messages, opts);
}
if ((self === narrowed_msg_list) && !self.empty() &&
!opts.delay_render) {
if ((self === narrowed_msg_list) && !self.empty()) {
// If adding some new messages to the message tables caused
// our current narrow to no longer be empty, hide the empty
// feed placeholder text.
narrow.hide_empty_narrow_message();
}
if ((self === narrowed_msg_list) && !self.empty() &&
(self.selected_id() === -1) && !opts.delay_render) {
// And also select the newly arrived message.
self.select_id(self.selected_id(), {then_scroll: true, use_closest: true});
}