Skip to content

Commit

Permalink
Merge pull request Expensify#53300 from nkdengineer/follow-up/52449
Browse files Browse the repository at this point in the history
fix: go to workspace chat bug
  • Loading branch information
grgia authored Dec 6, 2024
2 parents 3baf965 + aa178e9 commit 2dcfd50
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
3 changes: 3 additions & 0 deletions src/components/SubscriptAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ function SubscriptAvatar({
shouldRender={showTooltip}
accountID={Number(mainAvatar?.id ?? -1)}
icon={mainAvatar}
fallbackUserDetails={{
displayName: mainAvatar?.name,
}}
>
<View>
<Avatar
Expand Down
32 changes: 17 additions & 15 deletions src/pages/workspace/WorkspaceInitialPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function WorkspaceInitialPage({policyDraft, policy: policyProp, route}: Workspac
const currentUserPolicyExpenseChatReportID = getPolicyExpenseChat(accountID, policy?.id ?? '-1')?.reportID ?? '-1';
const [currentUserPolicyExpenseChat] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${currentUserPolicyExpenseChatReportID}`);
const {reportPendingAction} = getReportOfflinePendingActionAndErrors(currentUserPolicyExpenseChat);

const isPolicyExpenseChatEnabled = !!policy?.isPolicyExpenseChatEnabled;
const prevPendingFields = usePrevious(policy?.pendingFields);
const policyFeatureStates = useMemo(
() => ({
Expand Down Expand Up @@ -446,20 +446,22 @@ function WorkspaceInitialPage({policyDraft, policy: policyProp, route}: Workspac
))}
</View>
</OfflineWithFeedback>
<View style={[styles.pb4, styles.mh3, styles.mt3]}>
<Text style={[styles.textSupporting, styles.fontSizeLabel, styles.ph2]}>{translate('workspace.common.submitExpense')}</Text>
<OfflineWithFeedback pendingAction={reportPendingAction}>
<MenuItem
title={getReportName(currentUserPolicyExpenseChat)}
description={translate('workspace.common.workspace')}
icon={getIcons(currentUserPolicyExpenseChat, personalDetails)}
onPress={() => Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(currentUserPolicyExpenseChat?.reportID ?? '-1'))}
shouldShowRightIcon
wrapperStyle={[styles.br2, styles.pl2, styles.pr0, styles.pv3, styles.mt1, styles.alignItemsCenter]}
shouldShowSubscriptAvatar
/>
</OfflineWithFeedback>
</View>
{isPolicyExpenseChatEnabled && (
<View style={[styles.pb4, styles.mh3, styles.mt3]}>
<Text style={[styles.textSupporting, styles.fontSizeLabel, styles.ph2]}>{translate('workspace.common.submitExpense')}</Text>
<OfflineWithFeedback pendingAction={reportPendingAction}>
<MenuItem
title={getReportName(currentUserPolicyExpenseChat)}
description={translate('workspace.common.workspace')}
icon={getIcons(currentUserPolicyExpenseChat, personalDetails)}
onPress={() => Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(currentUserPolicyExpenseChat?.reportID ?? '-1'))}
shouldShowRightIcon
wrapperStyle={[styles.br2, styles.pl2, styles.pr0, styles.pv3, styles.mt1, styles.alignItemsCenter]}
shouldShowSubscriptAvatar
/>
</OfflineWithFeedback>
</View>
)}
</ScrollView>
<ConfirmModal
title={translate('workspace.bankAccount.workspaceCurrency')}
Expand Down

0 comments on commit 2dcfd50

Please sign in to comment.