mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	Debounce update_faded_messages to once per 150ms.
This is an attempt to make the compose box less sluggish. (imported from commit b1450216da0a92fc69e0d129a74e76eca37df1b5)
This commit is contained in:
		@@ -110,7 +110,8 @@ exports.unfade_messages = function (clear_state) {
 | 
			
		||||
    ui.update_floating_recipient_bar();
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
exports.update_faded_messages = function () {
 | 
			
		||||
function _update_faded_messages() {
 | 
			
		||||
    // See also update_faded_messages(), which just wraps this with a debounce.
 | 
			
		||||
    if (focused_recipient === undefined) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
@@ -148,7 +149,11 @@ exports.update_faded_messages = function () {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    ui.update_floating_recipient_bar();
 | 
			
		||||
};
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// See trac #1633.  For fast typists, calls to _update_faded_messages can
 | 
			
		||||
// cause typing sluggishness.
 | 
			
		||||
exports.update_faded_messages = _.debounce(_update_faded_messages, 150);
 | 
			
		||||
 | 
			
		||||
exports.update_recipient_on_narrow = function () {
 | 
			
		||||
    if (!compose.composing()) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user