mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	message_live_update: Fix double re-rendering of home_msg_list.
The previous logic incorrectly did current_msg_list plus home_msg_list, so if one wasn't narrowed, we did all the work twice.
This commit is contained in:
		@@ -3,13 +3,19 @@ var message_live_update = (function () {
 | 
			
		||||
var exports = {};
 | 
			
		||||
 | 
			
		||||
exports.update_stream_name = function (stream_id, new_name) {
 | 
			
		||||
    _.each([home_msg_list, current_msg_list, message_list.all], function (list) {
 | 
			
		||||
    _.each([home_msg_list, message_list.narrowed, message_list.all], function (list) {
 | 
			
		||||
        if (list === undefined) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        list.update_stream_name(stream_id, new_name);
 | 
			
		||||
    });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
exports.update_user_full_name = function (user_id, full_name) {
 | 
			
		||||
    _.each([home_msg_list, current_msg_list, message_list.all], function (list) {
 | 
			
		||||
    _.each([home_msg_list, message_list.narrowed, message_list.all], function (list) {
 | 
			
		||||
        if (list === undefined) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        list.update_user_full_name(user_id, full_name);
 | 
			
		||||
    });
 | 
			
		||||
};
 | 
			
		||||
@@ -18,7 +24,10 @@ exports.update_avatar = function (user_id, avatar_url) {
 | 
			
		||||
    var url = avatar_url;
 | 
			
		||||
    url = people.format_small_avatar_url(url);
 | 
			
		||||
 | 
			
		||||
    _.each([home_msg_list, current_msg_list, message_list.all], function (list) {
 | 
			
		||||
    _.each([home_msg_list, message_list.narrowed, message_list.all], function (list) {
 | 
			
		||||
        if (list === undefined) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        list.update_user_avatar(user_id, url);
 | 
			
		||||
    });
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user