mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 03:53:50 +00:00 
			
		
		
		
	typing_events: Fix early read of page_params.
For spectators, page_params.server_typing_started_expiry_period_milliseconds has not been initialized yet at module load time. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
		
				
					committed by
					
						 Tim Abbott
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							45c8dcc9c3
						
					
				
				
					commit
					06d439e0b2
				
			| @@ -15,10 +15,6 @@ import * as typing_data from "./typing_data"; | ||||
| // | ||||
| // We also handle the local event of re-narrowing. | ||||
| // (For the outbound code, see typing.js.) | ||||
| // | ||||
| // How long before we assume a client has gone away | ||||
| // and expire the active typing indicator. | ||||
| const typing_started_expiry_period = page_params.server_typing_started_expiry_period_milliseconds; | ||||
|  | ||||
| // If number of users typing exceed this, | ||||
| // we render "Several people are typing..." | ||||
| @@ -115,7 +111,11 @@ export function display_notification(event) { | ||||
|  | ||||
|     render_notifications_for_narrow(); | ||||
|  | ||||
|     typing_data.kickstart_inbound_timer(key, typing_started_expiry_period, () => { | ||||
|     typing_data.kickstart_inbound_timer( | ||||
|         key, | ||||
|         page_params.server_typing_started_expiry_period_milliseconds, | ||||
|         () => { | ||||
|             hide_notification(event); | ||||
|     }); | ||||
|         }, | ||||
|     ); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user