From 1a395823a44d9038755681af3c1019e30f45ae2c Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Fri, 29 Nov 2024 15:07:42 +0700 Subject: [PATCH 1/2] fix: go to workspace chat bug --- src/pages/workspace/WorkspaceInitialPage.tsx | 32 +++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/pages/workspace/WorkspaceInitialPage.tsx b/src/pages/workspace/WorkspaceInitialPage.tsx index c4f08f46704f..4c0cf77877b1 100644 --- a/src/pages/workspace/WorkspaceInitialPage.tsx +++ b/src/pages/workspace/WorkspaceInitialPage.tsx @@ -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( () => ({ @@ -446,20 +446,22 @@ function WorkspaceInitialPage({policyDraft, policy: policyProp, route}: Workspac ))} - - {translate('workspace.common.submitExpense')} - - 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 - /> - - + {isPolicyExpenseChatEnabled && ( + + {translate('workspace.common.submitExpense')} + + 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 + /> + + + )} Date: Fri, 29 Nov 2024 16:18:13 +0700 Subject: [PATCH 2/2] fix: tooltip width size --- src/components/SubscriptAvatar.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/SubscriptAvatar.tsx b/src/components/SubscriptAvatar.tsx index 4e23befcbb15..a74e8fe958e3 100644 --- a/src/components/SubscriptAvatar.tsx +++ b/src/components/SubscriptAvatar.tsx @@ -75,6 +75,9 @@ function SubscriptAvatar({ shouldRender={showTooltip} accountID={Number(mainAvatar?.id ?? -1)} icon={mainAvatar} + fallbackUserDetails={{ + displayName: mainAvatar?.name, + }} >