Skip to content

Commit

Permalink
Merge pull request #42805 from Krishna2323/krishna2323/issue/42751
Browse files Browse the repository at this point in the history
[CP Staging] fix: Chat - Display Name Appears Black and Members Not Ticked in Group Preview
  • Loading branch information
luacmartins authored May 30, 2024
2 parents 0e369b9 + 722b8b2 commit 99b0563
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/components/SelectionList/BaseSelectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,7 @@ function BaseSelectionList<TItem extends ListItem>(
shouldPreventDefaultFocusOnSelectRow={shouldPreventDefaultFocusOnSelectRow}
// We're already handling the Enter key press in the useKeyboardShortcut hook, so we don't want the list item to submit the form
shouldPreventEnterKeySubmit
// Change this because of lint
rightHandSideComponent={rightHandSideComponent && (typeof rightHandSideComponent === 'function' ? rightHandSideComponent({} as TItem) : rightHandSideComponent)}
rightHandSideComponent={rightHandSideComponent}
keyForList={item.keyForList ?? ''}
isMultilineSupported={isRowMultilineSupported}
onFocus={() => {
Expand Down
9 changes: 5 additions & 4 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ import * as ReportActionsUtils from './ReportActionsUtils';
import StringUtils from './StringUtils';
import * as TransactionUtils from './TransactionUtils';
import * as Url from './Url';
import type {AvatarSource} from './UserUtils';
import * as UserUtils from './UserUtils';

type AvatarRange = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18;
Expand Down Expand Up @@ -117,7 +118,7 @@ type SpendBreakdown = {
totalDisplaySpend: number;
};

type ParticipantDetails = [number, string, UserUtils.AvatarSource, UserUtils.AvatarSource];
type ParticipantDetails = [number, string, AvatarSource, AvatarSource];

type OptimisticAddCommentReportAction = Pick<
ReportAction,
Expand Down Expand Up @@ -587,7 +588,7 @@ function getLastUpdatedReport(): OnyxEntry<Report> {
return lastUpdatedReport;
}

function getCurrentUserAvatar(): UserUtils.AvatarSource | undefined {
function getCurrentUserAvatar(): AvatarSource | undefined {
return currentUserPersonalDetails?.avatar;
}

Expand Down Expand Up @@ -1714,7 +1715,7 @@ function getDefaultWorkspaceAvatarTestID(workspaceName: string): string {
return !alphaNumeric ? defaultAvatarBuildingIconTestID : `SvgDefaultAvatar_${alphaNumeric[0]} Icon`;
}

function getWorkspaceAvatar(report: OnyxEntry<Report>): UserUtils.AvatarSource {
function getWorkspaceAvatar(report: OnyxEntry<Report>): AvatarSource {
const workspaceName = getPolicyName(report, false, allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]);
const avatar = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]?.avatarURL ?? '';
return !isEmpty(avatar) ? avatar : getDefaultWorkspaceAvatar(workspaceName);
Expand Down Expand Up @@ -1921,7 +1922,7 @@ function getParticipants(reportID: string) {
function getIcons(
report: OnyxEntry<Report>,
personalDetails: OnyxCollection<PersonalDetails>,
defaultIcon: UserUtils.AvatarSource | null = null,
defaultIcon: AvatarSource | null = null,
defaultName = '',
defaultAccountID = -1,
policy: OnyxEntry<Policy> = null,
Expand Down

0 comments on commit 99b0563

Please sign in to comment.