mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 01:16:19 +00:00
Cause update_floating_recipient_bar to get called less frequently.
Putting update_floating_recipient_bar in the old location caused it to be called on every single keypress, which is unnecessarily expensive. Instead, just call it once when we think we might actually need it: after initiating a narrow. (imported from commit a6c1518c4001a2dde44d7b512236795da3ccd351)
This commit is contained in:
@@ -228,6 +228,10 @@ exports.activate = function (operators, opts) {
|
||||
hashchange.save_narrow(operators);
|
||||
$('#search_query').val(unparse(operators));
|
||||
search.update_button_visibility();
|
||||
// For good measure, redraw the floating recipient bar
|
||||
// (if the page didn't scroll in achieving this narrow,
|
||||
// it might still read the wrong thing.)
|
||||
ui.update_floating_recipient_bar();
|
||||
};
|
||||
|
||||
// Activate narrowing with a single operator.
|
||||
|
||||
@@ -189,7 +189,6 @@ function select_message(next_message, opts) {
|
||||
|
||||
if (opts.then_scroll) {
|
||||
recenter_view(next_message);
|
||||
ui.update_floating_recipient_bar();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user