From ec5d433f46df3f9bcd0ebd842e3ff2670b347b04 Mon Sep 17 00:00:00 2001 From: kubabutkiewicz Date: Wed, 26 Mar 2025 17:00:22 +0100 Subject: [PATCH 1/5] add logs to identify if the onyx data is loaded at all if we land on wohoo screen --- src/components/LHNOptionsList/LHNOptionsList.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/components/LHNOptionsList/LHNOptionsList.tsx b/src/components/LHNOptionsList/LHNOptionsList.tsx index 4c6fa3b60b85..882863752e9c 100644 --- a/src/components/LHNOptionsList/LHNOptionsList.tsx +++ b/src/components/LHNOptionsList/LHNOptionsList.tsx @@ -20,6 +20,7 @@ import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import {isValidDraftComment} from '@libs/DraftCommentUtils'; import getPlatform from '@libs/getPlatform'; +import Log from '@libs/Log'; import {getIOUReportIDOfLastAction, getLastMessageTextForReport} from '@libs/OptionsListUtils'; import {getOneTransactionThreadReportID, getOriginalMessage, getSortedReportActionsForDisplay, isMoneyRequestAction} from '@libs/ReportActionsUtils'; import {canUserPerformWriteAction} from '@libs/ReportUtils'; @@ -288,6 +289,19 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio }); }, [getScrollOffset, route, isWebOrDesktop]); + useEffect(() => { + if (shouldShowEmptyLHN) { + Log.info('Whohoo! All caught up. Was rendered', false, { + reportsCount: Object.keys(reports ?? {}).length, + reportActionsCount: Object.keys(reportActions ?? {}).length, + policyCount: Object.keys(policy ?? {}).length, + personalDetailsCount: Object.keys(personalDetails ?? {}).length, + route, + reportsIDsFromUseReportsCount: data.length, + }); + } + }, [data, shouldShowEmptyLHN, route]); + return ( {shouldShowEmptyLHN ? ( From 1e796d93b2a8de237c58bf778f473cf918f98e8a Mon Sep 17 00:00:00 2001 From: kubabutkiewicz Date: Wed, 26 Mar 2025 17:27:08 +0100 Subject: [PATCH 2/5] fix lint --- src/components/LHNOptionsList/LHNOptionsList.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/LHNOptionsList/LHNOptionsList.tsx b/src/components/LHNOptionsList/LHNOptionsList.tsx index 882863752e9c..39c5b93e5fbb 100644 --- a/src/components/LHNOptionsList/LHNOptionsList.tsx +++ b/src/components/LHNOptionsList/LHNOptionsList.tsx @@ -289,6 +289,7 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio }); }, [getScrollOffset, route, isWebOrDesktop]); + // eslint-disable-next-line rulesdir/prefer-early-return useEffect(() => { if (shouldShowEmptyLHN) { Log.info('Whohoo! All caught up. Was rendered', false, { @@ -300,7 +301,7 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio reportsIDsFromUseReportsCount: data.length, }); } - }, [data, shouldShowEmptyLHN, route]); + }, [data, shouldShowEmptyLHN, route, reports, reportActions, policy, personalDetails]); return ( From 129b3bea33383c5c1ee5a7e8f0f30c8f0ffab326 Mon Sep 17 00:00:00 2001 From: kubabutkiewicz Date: Wed, 26 Mar 2025 17:28:08 +0100 Subject: [PATCH 3/5] lint --- .../LHNOptionsList/LHNOptionsList.tsx | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/components/LHNOptionsList/LHNOptionsList.tsx b/src/components/LHNOptionsList/LHNOptionsList.tsx index 39c5b93e5fbb..39239e0fa03c 100644 --- a/src/components/LHNOptionsList/LHNOptionsList.tsx +++ b/src/components/LHNOptionsList/LHNOptionsList.tsx @@ -289,18 +289,19 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio }); }, [getScrollOffset, route, isWebOrDesktop]); - // eslint-disable-next-line rulesdir/prefer-early-return useEffect(() => { - if (shouldShowEmptyLHN) { - Log.info('Whohoo! All caught up. Was rendered', false, { - reportsCount: Object.keys(reports ?? {}).length, - reportActionsCount: Object.keys(reportActions ?? {}).length, - policyCount: Object.keys(policy ?? {}).length, - personalDetailsCount: Object.keys(personalDetails ?? {}).length, - route, - reportsIDsFromUseReportsCount: data.length, - }); + if (!shouldShowEmptyLHN) { + return; } + + Log.info('Whohoo! All caught up. Was rendered', false, { + reportsCount: Object.keys(reports ?? {}).length, + reportActionsCount: Object.keys(reportActions ?? {}).length, + policyCount: Object.keys(policy ?? {}).length, + personalDetailsCount: Object.keys(personalDetails ?? {}).length, + route, + reportsIDsFromUseReportsCount: data.length, + }); }, [data, shouldShowEmptyLHN, route, reports, reportActions, policy, personalDetails]); return ( From 848755c243362639a42b4c7a5e8c25451b322bf2 Mon Sep 17 00:00:00 2001 From: kubabutkiewicz Date: Wed, 26 Mar 2025 17:28:27 +0100 Subject: [PATCH 4/5] revert last change --- .../LHNOptionsList/LHNOptionsList.tsx | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/components/LHNOptionsList/LHNOptionsList.tsx b/src/components/LHNOptionsList/LHNOptionsList.tsx index 39239e0fa03c..39c5b93e5fbb 100644 --- a/src/components/LHNOptionsList/LHNOptionsList.tsx +++ b/src/components/LHNOptionsList/LHNOptionsList.tsx @@ -289,19 +289,18 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio }); }, [getScrollOffset, route, isWebOrDesktop]); + // eslint-disable-next-line rulesdir/prefer-early-return useEffect(() => { - if (!shouldShowEmptyLHN) { - return; + if (shouldShowEmptyLHN) { + Log.info('Whohoo! All caught up. Was rendered', false, { + reportsCount: Object.keys(reports ?? {}).length, + reportActionsCount: Object.keys(reportActions ?? {}).length, + policyCount: Object.keys(policy ?? {}).length, + personalDetailsCount: Object.keys(personalDetails ?? {}).length, + route, + reportsIDsFromUseReportsCount: data.length, + }); } - - Log.info('Whohoo! All caught up. Was rendered', false, { - reportsCount: Object.keys(reports ?? {}).length, - reportActionsCount: Object.keys(reportActions ?? {}).length, - policyCount: Object.keys(policy ?? {}).length, - personalDetailsCount: Object.keys(personalDetails ?? {}).length, - route, - reportsIDsFromUseReportsCount: data.length, - }); }, [data, shouldShowEmptyLHN, route, reports, reportActions, policy, personalDetails]); return ( From 79dc0cb2c3f5b6b7d15797ca145be3733e5996e6 Mon Sep 17 00:00:00 2001 From: kubabutkiewicz Date: Thu, 27 Mar 2025 08:33:24 +0100 Subject: [PATCH 5/5] fix typo --- src/components/LHNOptionsList/LHNOptionsList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/LHNOptionsList/LHNOptionsList.tsx b/src/components/LHNOptionsList/LHNOptionsList.tsx index 39c5b93e5fbb..ebadc9401ccf 100644 --- a/src/components/LHNOptionsList/LHNOptionsList.tsx +++ b/src/components/LHNOptionsList/LHNOptionsList.tsx @@ -292,7 +292,7 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio // eslint-disable-next-line rulesdir/prefer-early-return useEffect(() => { if (shouldShowEmptyLHN) { - Log.info('Whohoo! All caught up. Was rendered', false, { + Log.info('Woohoo! All caught up. Was rendered', false, { reportsCount: Object.keys(reports ?? {}).length, reportActionsCount: Object.keys(reportActions ?? {}).length, policyCount: Object.keys(policy ?? {}).length,