From e6eb892e0ebe94ec63761906de3226fc3e52c059 Mon Sep 17 00:00:00 2001 From: Srikar Parsi Date: Mon, 29 Apr 2024 15:29:01 -0400 Subject: [PATCH 1/4] Add 500ms timeout between RHP and training video --- .../sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx index adc5f3517c11..b873170c971f 100644 --- a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx +++ b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx @@ -299,7 +299,7 @@ function FloatingActionButtonAndPopover( { icon: Expensicons.DocumentPlus, text: translate('iou.trackExpense'), - onSelected: () => { + onSelected: async () => { interceptAnonymousUser(() => IOU.startMoneyRequest( CONST.IOU.TYPE.TRACK, @@ -309,6 +309,7 @@ function FloatingActionButtonAndPopover( ReportUtils.findSelfDMReportID() || ReportUtils.generateReportID(), ), ); + await new Promise((resolve) => setTimeout(resolve, 500)); if (!hasSeenTrackTraining && !isOffline) { Navigation.navigate(ROUTES.TRACK_TRAINING_MODAL); } From f45a75359b3ead739aa44581b255ba729f7313e1 Mon Sep 17 00:00:00 2001 From: Srikar Parsi Date: Mon, 29 Apr 2024 17:03:02 -0400 Subject: [PATCH 2/4] refactor code --- .../SidebarScreen/FloatingActionButtonAndPopover.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx index b873170c971f..8ba49a1dfe9c 100644 --- a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx +++ b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx @@ -299,7 +299,7 @@ function FloatingActionButtonAndPopover( { icon: Expensicons.DocumentPlus, text: translate('iou.trackExpense'), - onSelected: async () => { + onSelected: () => { interceptAnonymousUser(() => IOU.startMoneyRequest( CONST.IOU.TYPE.TRACK, @@ -309,10 +309,11 @@ function FloatingActionButtonAndPopover( ReportUtils.findSelfDMReportID() || ReportUtils.generateReportID(), ), ); - await new Promise((resolve) => setTimeout(resolve, 500)); - if (!hasSeenTrackTraining && !isOffline) { - Navigation.navigate(ROUTES.TRACK_TRAINING_MODAL); - } + setTimeout(() => { + if (!hasSeenTrackTraining && !isOffline) { + Navigation.navigate(ROUTES.TRACK_TRAINING_MODAL); + } + }, 300); }, }, ] From b60404078c03a4ad49dec7d6aa739b31ad386011 Mon Sep 17 00:00:00 2001 From: Srikar Parsi Date: Mon, 29 Apr 2024 17:04:07 -0400 Subject: [PATCH 3/4] use const --- .../sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx index 8ba49a1dfe9c..af67c918108e 100644 --- a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx +++ b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx @@ -313,7 +313,7 @@ function FloatingActionButtonAndPopover( if (!hasSeenTrackTraining && !isOffline) { Navigation.navigate(ROUTES.TRACK_TRAINING_MODAL); } - }, 300); + }, CONST.ANIMATED_TRANSITION); }, }, ] From 12c0936ff8e5cc7466d20c523880099810e9f85e Mon Sep 17 00:00:00 2001 From: Srikar Parsi <48188732+srikarparsi@users.noreply.github.com> Date: Mon, 29 Apr 2024 17:47:57 -0400 Subject: [PATCH 4/4] lint --- .../SidebarScreen/FloatingActionButtonAndPopover.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx index 5bc72c3e86b2..9429591b851f 100644 --- a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx +++ b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx @@ -331,11 +331,11 @@ function FloatingActionButtonAndPopover( ReportUtils.findSelfDMReportID() || ReportUtils.generateReportID(), ), ); - setTimeout(() => { - if (!hasSeenTrackTraining && !isOffline) { + if (!hasSeenTrackTraining && !isOffline) { + setTimeout(() => { Navigation.navigate(ROUTES.TRACK_TRAINING_MODAL); - } - }, CONST.ANIMATED_TRANSITION); + }, CONST.ANIMATED_TRANSITION); + } }, }, ]