Skip to content

Commit

Permalink
fix: more lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispader committed Feb 7, 2025
1 parent 9ac0f70 commit 43918f3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import useReimbursementAccountStepFormSubmit from '@hooks/useReimbursementAccoun
import type {SubStepProps} from '@hooks/useSubStep/types';
import useThemeStyles from '@hooks/useThemeStyles';
import {setDraftValues} from '@libs/actions/FormActions';
import {getFieldRequiredErrors} from '@libs/ValidationUtils';
import type {FileObject} from '@pages/media/AttachmentModalScreen/types';
import WhyLink from '@pages/ReimbursementAccount/NonUSD/WhyLink';
import CONST from '@src/CONST';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const ReportAvatarModalContent: AttachmentModalContent = ({params, children}) =>
const attachment = useMemo(() => {
if (isGroupChat(report) && !isThread(report)) {
return {
source: report?.avatarUrl ? getFullSizeAvatar(report.avatarUrl, 0) : getDefaultGroupAvatar(report?.reportID ?? ''),
source: report?.avatarUrl ? getFullSizeAvatar(report.avatarUrl, 0) : getDefaultGroupAvatar(report?.reportID),
headerTitle: getReportName(report),
isWorkspaceAvatar: false,
};
Expand All @@ -30,7 +30,7 @@ const ReportAvatarModalContent: AttachmentModalContent = ({params, children}) =>
source: getFullSizeAvatar(getWorkspaceIcon(report).source, 0),
headerTitle: getPolicyName({report, policy}),
// In the case of default workspace avatar, originalFileName prop takes policyID as value to get the color of the avatar
originalFileName: policy?.originalFileName ?? policy?.id ?? report?.policyID ?? '',
originalFileName: policy?.originalFileName ?? policy?.id ?? report?.policyID,
isWorkspaceAvatar: true,
};
}, [policy, report]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import {useMemo} from 'react';
import {useOnyx} from 'react-native-onyx';
import {getDefaultWorkspaceAvatar} from '@libs/ReportUtils';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type {AttachmentModalBaseContentProps} from './BaseContent';
import type {AttachmentModalContent} from './types';

const WorkspaceAvatarModalContent: AttachmentModalContent = ({params, children}) => {
const policyID = params.policyID ?? '-1';
const policyID = params.policyID ?? CONST.DEFAULT_NUMBER_ID;
const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`);
const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP, {initialValue: true});

const contentProps = useMemo(
() =>
({
source: policy?.avatarURL ?? '' ? policy?.avatarURL ?? '' : getDefaultWorkspaceAvatar(policy?.name ?? ''),
headerTitle: policy?.name ?? '',
source: policy?.avatarURL ? policy?.avatarURL : getDefaultWorkspaceAvatar(policy?.name),
headerTitle: policy?.name,
isWorkspaceAvatar: true,
originalFileName: policy?.originalFileName ?? policy?.id,
shouldShowNotFoundPage: !Object.keys(policy ?? {}).length && !isLoadingApp,
Expand Down

0 comments on commit 43918f3

Please sign in to comment.