@@ -9,7 +9,6 @@ import BlockingView from '@components/BlockingViews/BlockingView';
99import Icon from '@components/Icon' ;
1010import * as Expensicons from '@components/Icon/Expensicons' ;
1111import LottieAnimations from '@components/LottieAnimations' ;
12- import { useProductTrainingContext } from '@components/ProductTrainingContext' ;
1312import { ScrollOffsetContext } from '@components/ScrollOffsetContextProvider' ;
1413import TextBlock from '@components/TextBlock' ;
1514import useLHNEstimatedListSize from '@hooks/useLHNEstimatedListSize' ;
@@ -25,10 +24,12 @@ import Log from '@libs/Log';
2524import { getIOUReportIDOfLastAction , getLastMessageTextForReport , hasReportErrors } from '@libs/OptionsListUtils' ;
2625import { getOneTransactionThreadReportID , getOriginalMessage , getSortedReportActionsForDisplay , isMoneyRequestAction } from '@libs/ReportActionsUtils' ;
2726import { canUserPerformWriteAction , requiresAttentionFromCurrentUser } from '@libs/ReportUtils' ;
27+ import isProductTrainingElementDismissed from '@libs/TooltipUtils' ;
2828import variables from '@styles/variables' ;
2929import CONST from '@src/CONST' ;
3030import ONYXKEYS from '@src/ONYXKEYS' ;
3131import type { PersonalDetails } from '@src/types/onyx' ;
32+ import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue' ;
3233import OptionRowLHNData from './OptionRowLHNData' ;
3334import OptionRowRendererComponent from './OptionRowRendererComponent' ;
3435import type { LHNOptionsListProps , RenderItemProps } from './types' ;
@@ -50,6 +51,7 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
5051 const [ transactions ] = useOnyx ( ONYXKEYS . COLLECTION . TRANSACTION , { canBeMissing : false } ) ;
5152 const [ draftComments ] = useOnyx ( ONYXKEYS . COLLECTION . REPORT_DRAFT_COMMENT , { canBeMissing : false } ) ;
5253 const [ transactionViolations ] = useOnyx ( ONYXKEYS . COLLECTION . TRANSACTION_VIOLATIONS , { canBeMissing : false } ) ;
54+ const [ dismissedProductTraining , dismissedProductTrainingMetadata ] = useOnyx ( ONYXKEYS . NVP_DISMISSED_PRODUCT_TRAINING , { canBeMissing : true } ) ;
5355
5456 const theme = useTheme ( ) ;
5557 const styles = useThemeStyles ( ) ;
@@ -59,10 +61,11 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
5961 const estimatedItemSize = optionMode === CONST . OPTION_MODE . COMPACT ? variables . optionRowHeightCompact : variables . optionRowHeight ;
6062 const platform = getPlatform ( ) ;
6163 const isWebOrDesktop = platform === CONST . PLATFORM . WEB || platform === CONST . PLATFORM . DESKTOP ;
64+ const isGBRorRBRTooltipDismissed =
65+ ! isLoadingOnyxValue ( dismissedProductTrainingMetadata ) && isProductTrainingElementDismissed ( CONST . PRODUCT_TRAINING_TOOLTIP_NAMES . GBR_RBR_CHAT , dismissedProductTraining ) ;
6266
63- const { shouldShowProductTrainingTooltip} = useProductTrainingContext ( CONST . PRODUCT_TRAINING_TOOLTIP_NAMES . GBR_RBR_CHAT , true ) ;
6467 const firstReportIDWithGBRorRBR = useMemo ( ( ) => {
65- if ( ! shouldShowProductTrainingTooltip ) {
68+ if ( isGBRorRBRTooltipDismissed ) {
6669 return undefined ;
6770 }
6871 return data . find ( ( reportID ) => {
@@ -79,7 +82,7 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
7982 const hasGBR = requiresAttentionFromCurrentUser ( itemFullReport , itemParentReportAction ) ;
8083 return hasGBR ;
8184 } ) ;
82- } , [ shouldShowProductTrainingTooltip , data , reportActions , reports ] ) ;
85+ } , [ isGBRorRBRTooltipDismissed , data , reportActions , reports ] ) ;
8386
8487 // When the first item renders we want to call the onFirstItemRendered callback.
8588 // At this point in time we know that the list is actually displaying items.
0 commit comments