From 942537b8a88d3fdbdd427302e5619b34ec4ba5dd Mon Sep 17 00:00:00 2001 From: Ionatan Wiznia Date: Wed, 20 Mar 2024 19:24:52 -0300 Subject: [PATCH] Ensure we send the typing indicator as soon as you type and once every 1 second afterwards as long as you are typing --- .../ComposerWithSuggestions.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx index cf3761a8d76a..2830eb5546eb 100644 --- a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx +++ b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx @@ -179,9 +179,16 @@ const isIOSNative = getPlatform() === CONST.PLATFORM.IOS; /** * Broadcast that the user is typing. Debounced to limit how often we publish client events. */ -const debouncedBroadcastUserIsTyping = lodashDebounce((reportID: string) => { - Report.broadcastUserIsTyping(reportID); -}, 100); +const debouncedBroadcastUserIsTyping = lodashDebounce( + (reportID: string) => { + Report.broadcastUserIsTyping(reportID); + }, + 1000, + { + maxWait: 1000, + leading: true, + }, +); const willBlurTextInputOnTapOutside = willBlurTextInputOnTapOutsideFunc();