@@ -9,7 +9,6 @@ import BlockingView from '@components/BlockingViews/BlockingView';
9
9
import Icon from '@components/Icon' ;
10
10
import * as Expensicons from '@components/Icon/Expensicons' ;
11
11
import LottieAnimations from '@components/LottieAnimations' ;
12
- import { useProductTrainingContext } from '@components/ProductTrainingContext' ;
13
12
import { ScrollOffsetContext } from '@components/ScrollOffsetContextProvider' ;
14
13
import TextBlock from '@components/TextBlock' ;
15
14
import useLHNEstimatedListSize from '@hooks/useLHNEstimatedListSize' ;
@@ -25,10 +24,12 @@ import Log from '@libs/Log';
25
24
import { getIOUReportIDOfLastAction , getLastMessageTextForReport , hasReportErrors } from '@libs/OptionsListUtils' ;
26
25
import { getOneTransactionThreadReportID , getOriginalMessage , getSortedReportActionsForDisplay , isMoneyRequestAction } from '@libs/ReportActionsUtils' ;
27
26
import { canUserPerformWriteAction , requiresAttentionFromCurrentUser } from '@libs/ReportUtils' ;
27
+ import isProductTrainingElementDismissed from '@libs/TooltipUtils' ;
28
28
import variables from '@styles/variables' ;
29
29
import CONST from '@src/CONST' ;
30
30
import ONYXKEYS from '@src/ONYXKEYS' ;
31
31
import type { PersonalDetails } from '@src/types/onyx' ;
32
+ import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue' ;
32
33
import OptionRowLHNData from './OptionRowLHNData' ;
33
34
import OptionRowRendererComponent from './OptionRowRendererComponent' ;
34
35
import type { LHNOptionsListProps , RenderItemProps } from './types' ;
@@ -50,6 +51,7 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
50
51
const [ transactions ] = useOnyx ( ONYXKEYS . COLLECTION . TRANSACTION , { canBeMissing : false } ) ;
51
52
const [ draftComments ] = useOnyx ( ONYXKEYS . COLLECTION . REPORT_DRAFT_COMMENT , { canBeMissing : false } ) ;
52
53
const [ transactionViolations ] = useOnyx ( ONYXKEYS . COLLECTION . TRANSACTION_VIOLATIONS , { canBeMissing : false } ) ;
54
+ const [ dismissedProductTraining , dismissedProductTrainingMetadata ] = useOnyx ( ONYXKEYS . NVP_DISMISSED_PRODUCT_TRAINING , { canBeMissing : true } ) ;
53
55
54
56
const theme = useTheme ( ) ;
55
57
const styles = useThemeStyles ( ) ;
@@ -59,10 +61,11 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
59
61
const estimatedItemSize = optionMode === CONST . OPTION_MODE . COMPACT ? variables . optionRowHeightCompact : variables . optionRowHeight ;
60
62
const platform = getPlatform ( ) ;
61
63
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 ) ;
62
66
63
- const { shouldShowProductTrainingTooltip} = useProductTrainingContext ( CONST . PRODUCT_TRAINING_TOOLTIP_NAMES . GBR_RBR_CHAT , true ) ;
64
67
const firstReportIDWithGBRorRBR = useMemo ( ( ) => {
65
- if ( ! shouldShowProductTrainingTooltip ) {
68
+ if ( isGBRorRBRTooltipDismissed ) {
66
69
return undefined ;
67
70
}
68
71
return data . find ( ( reportID ) => {
@@ -79,7 +82,7 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
79
82
const hasGBR = requiresAttentionFromCurrentUser ( itemFullReport , itemParentReportAction ) ;
80
83
return hasGBR ;
81
84
} ) ;
82
- } , [ shouldShowProductTrainingTooltip , data , reportActions , reports ] ) ;
85
+ } , [ isGBRorRBRTooltipDismissed , data , reportActions , reports ] ) ;
83
86
84
87
// When the first item renders we want to call the onFirstItemRendered callback.
85
88
// At this point in time we know that the list is actually displaying items.
0 commit comments