From 62a5d45d297746d46ecbdc4839af1e00b2004795 Mon Sep 17 00:00:00 2001 From: Kevin L <40267301+a8ck3n@users.noreply.github.com> Date: Mon, 30 Sep 2024 16:49:48 +0800 Subject: [PATCH] Stats: Remove timeout when closing feedback modal (#95015) --- client/my-sites/stats/feedback/modal/index.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/client/my-sites/stats/feedback/modal/index.tsx b/client/my-sites/stats/feedback/modal/index.tsx index 92a1d0a3ccbeb..d70510d292059 100644 --- a/client/my-sites/stats/feedback/modal/index.tsx +++ b/client/my-sites/stats/feedback/modal/index.tsx @@ -55,13 +55,11 @@ const FeedbackModal: React.FC< ModalProps > = ( { siteId, onClose } ) => { const handleClose = useCallback( ( isDirectClose: boolean = false ) => { - setTimeout( () => { - onClose(); + onClose(); - if ( isDirectClose ) { - trackStatsAnalyticsEvent( 'stats_feedback_action_directly_close_form_modal' ); - } - }, 200 ); + if ( isDirectClose ) { + trackStatsAnalyticsEvent( 'stats_feedback_action_directly_close_form_modal' ); + } }, [ onClose ] );