@@ -51,7 +51,6 @@ function TransactionListItem<TItem extends ListItem>({
5151 shouldSyncFocus,
5252 columns,
5353 isLoading,
54- violations,
5554 nonPersonalAndWorkspaceCards,
5655 lastPaymentMethod,
5756 personalPolicyID,
@@ -96,6 +95,7 @@ function TransactionListItem<TItem extends ListItem>({
9695 const [ parentReport ] = originalUseOnyx ( `${ ONYXKEYS . COLLECTION . REPORT } ${ getNonEmptyStringOnyxID ( transactionItem . reportID ) } ` ) ;
9796 const [ transactionThreadReport ] = originalUseOnyx ( `${ ONYXKEYS . COLLECTION . REPORT } ${ transactionItem ?. reportAction ?. childReportID } ` ) ;
9897 const [ transaction ] = originalUseOnyx ( `${ ONYXKEYS . COLLECTION . TRANSACTION } ${ getNonEmptyStringOnyxID ( transactionItem . transactionID ) } ` ) ;
98+ const [ transactionViolations ] = originalUseOnyx ( `${ ONYXKEYS . COLLECTION . TRANSACTION_VIOLATIONS } ${ getNonEmptyStringOnyxID ( transactionItem . transactionID ) } ` ) ;
9999 const parentReportActionSelector = ( reportActions : OnyxEntry < ReportActions > ) : OnyxEntry < ReportAction > => reportActions ?. [ `${ transactionItem ?. reportAction ?. reportActionID } ` ] ;
100100 const [ parentReportAction ] = originalUseOnyx ( `${ ONYXKEYS . COLLECTION . REPORT_ACTIONS } ${ getNonEmptyStringOnyxID ( transactionItem . reportID ) } ` , { selector : parentReportActionSelector } , [
101101 transactionItem ,
@@ -149,7 +149,7 @@ function TransactionListItem<TItem extends ListItem>({
149149 const policyForViolations = parentPolicy ?? snapshotPolicy ;
150150 const reportForViolations = parentReport ?? snapshotReport ;
151151
152- const onyxViolations = ( violations ?. [ ` ${ ONYXKEYS . COLLECTION . TRANSACTION_VIOLATIONS } ${ transactionItem . transactionID } ` ] ?? [ ] ) . filter (
152+ const onyxViolations = ( transactionViolations ?? [ ] ) . filter (
153153 ( violation : TransactionViolation ) =>
154154 ! isViolationDismissed ( transactionItem , violation , currentUserDetails . email ?? '' , currentUserDetails . accountID , reportForViolations , policyForViolations ) &&
155155 shouldShowViolation ( reportForViolations , policyForViolations , violation . name , currentUserDetails . email ?? '' , false , transactionItem ) ,
@@ -169,7 +169,7 @@ function TransactionListItem<TItem extends ListItem>({
169169 isInvoice ,
170170 ) ;
171171
172- const transactionViolations = mergeProhibitedViolations ( attendeeOnyxViolations ) ;
172+ const mergedTransactionViolations = mergeProhibitedViolations ( attendeeOnyxViolations ) ;
173173
174174 const { isDelegateAccessRestricted} = useDelegateNoAccessState ( ) ;
175175 const { showDelegateNoAccessModal} = useDelegateNoAccessActions ( ) ;
@@ -270,7 +270,7 @@ function TransactionListItem<TItem extends ListItem>({
270270 ! isLargeScreenWidth && [ styles . p0 , styles . pt3 , isLastItem ? styles . searchTableBottomRadius : styles . noBorderRadius ] ,
271271 isLargeScreenWidth && ( isLastItem ? styles . searchTableBottomRadius : styles . noBorderRadius ) ,
272272 ] }
273- violations = { transactionViolations }
273+ violations = { mergedTransactionViolations }
274274 onArrowRightPress = { isDeletedTransaction ? undefined : ( ) => onSelectRow ( item , transactionPreviewData ) }
275275 isHover = { hovered }
276276 nonPersonalAndWorkspaceCards = { nonPersonalAndWorkspaceCards }
0 commit comments