Skip to content

Commit 0e7b8fd

Browse files
authored
Merge pull request Expensify#68713 from dmkt9/fix/67138
Fix/67138 - Red dots and green dots aren't shown in recent chats like in LHN
2 parents 1560a56 + a2a9562 commit 0e7b8fd

4 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/components/Search/SearchAutocompleteList.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ function SearchRouterItem(props: UserListItemProps<OptionData> | SearchQueryList
139139
<SearchQueryListItem
140140
// eslint-disable-next-line react/jsx-props-no-spreading
141141
{...props}
142+
shouldDisplayRBR
142143
/>
143144
);
144145
}
@@ -147,6 +148,7 @@ function SearchRouterItem(props: UserListItemProps<OptionData> | SearchQueryList
147148
pressableStyle={[styles.br2, styles.ph3]}
148149
// eslint-disable-next-line react/jsx-props-no-spreading
149150
{...props}
151+
shouldDisplayRBR
150152
/>
151153
);
152154
}

src/components/SelectionList/Search/SearchQueryListItem.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ type SearchQueryListItemProps = {
2727
onSelectRow: (item: SearchQueryItem) => void;
2828
onFocus?: ListItemFocusEventHandler;
2929
shouldSyncFocus?: boolean;
30+
/** Whether to show RBR */
31+
shouldDisplayRBR?: boolean;
3032
};
3133

3234
function isSearchQueryItem(item: OptionData | SearchQueryItem): item is SearchQueryItem {
3335
return 'searchItemType' in item;
3436
}
3537

36-
function SearchQueryListItem({item, isFocused, showTooltip, onSelectRow, onFocus, shouldSyncFocus}: SearchQueryListItemProps) {
38+
function SearchQueryListItem({item, isFocused, showTooltip, onSelectRow, onFocus, shouldSyncFocus, shouldDisplayRBR}: SearchQueryListItemProps) {
3739
const styles = useThemeStyles();
3840
const theme = useTheme();
3941

@@ -49,6 +51,7 @@ function SearchQueryListItem({item, isFocused, showTooltip, onSelectRow, onFocus
4951
hoverStyle={item.isSelected && styles.activeComponentBG}
5052
shouldSyncFocus={shouldSyncFocus}
5153
showTooltip={showTooltip}
54+
shouldDisplayRBR={shouldDisplayRBR}
5255
>
5356
<>
5457
{!!item.singleIcon && (

src/components/SelectionList/UserListItem.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ function UserListItem<TItem extends ListItem>({
3434
wrapperStyle,
3535
pressableStyle,
3636
shouldUseDefaultRightHandSideCheckmark,
37+
shouldDisplayRBR,
3738
}: UserListItemProps<TItem>) {
3839
const styles = useThemeStyles();
3940
const theme = useTheme();
@@ -91,6 +92,7 @@ function UserListItem<TItem extends ListItem>({
9192
keyForList={item.keyForList}
9293
onFocus={onFocus}
9394
shouldSyncFocus={shouldSyncFocus}
95+
shouldDisplayRBR={shouldDisplayRBR}
9496
>
9597
{(hovered?: boolean) => (
9698
<>

src/libs/OptionsListUtils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -953,8 +953,9 @@ function createOption(
953953
result.shouldShowSubscript = shouldReportShowSubscript(report, !!result.private_isArchived);
954954
result.isPolicyExpenseChat = reportUtilsIsPolicyExpenseChat(report);
955955
result.isOwnPolicyExpenseChat = report.isOwnPolicyExpenseChat ?? false;
956-
result.allReportErrors = reportAttributesDerived?.[report.reportID]?.reportErrors ?? {};
957-
result.brickRoadIndicator = !isEmptyObject(result.allReportErrors) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : '';
956+
const reportAttribute = reportAttributesDerived?.[report.reportID];
957+
result.allReportErrors = reportAttribute?.reportErrors ?? {};
958+
result.brickRoadIndicator = !isEmptyObject(result.allReportErrors) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : (reportAttribute?.brickRoadStatus ?? '');
958959
result.pendingAction = report.pendingFields ? (report.pendingFields.addWorkspaceRoom ?? report.pendingFields.createChat) : undefined;
959960
result.ownerAccountID = report.ownerAccountID;
960961
result.reportID = report.reportID;

0 commit comments

Comments
 (0)