Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function ProductTrainingTooltip({optionItem, children}: ProductTrainingTooltipPr
const shouldShowRBRorGBRTooltip = firstReportIDWithGBRorRBR === optionItem.reportID;
const isOnboardingGuideAssigned = onboardingPurpose === CONST.ONBOARDING_CHOICES.MANAGE_TEAM && !session?.email?.includes('+');
const isChatUsedForOnboarding = isChatUsedForOnboardingReportUtils(optionItem, onboarding, conciergeReportID, onboardingPurpose);
const shouldShowGetStartedTooltip = isOnboardingGuideAssigned ? isAdminRoom(optionItem) && isChatUsedForOnboarding : isConciergeChatReport(optionItem);
const shouldShowGetStartedTooltip = isOnboardingGuideAssigned ? isAdminRoom(optionItem) && isChatUsedForOnboarding : isConciergeChatReport(optionItem, conciergeReportID);

// Skip the inner component (and its heavy hooks) entirely when the row can never show a tooltip.
const shouldEvaluateTooltip = shouldShowRBRorGBRTooltip || shouldShowGetStartedTooltip;
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useBankAccountUnlockEffect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function useBankAccountUnlockEffect(report: OnyxEntry<Report> | undefined) {
const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);

useEffect(() => {
if (!isConciergeChatReport(report) || !initiatingBankAccountUnlock?.bankAccountIDToUnlock) {
if (!isConciergeChatReport(report, conciergeReportID) || !initiatingBankAccountUnlock?.bankAccountIDToUnlock) {
return;
}
initiateBankAccountUnlock(initiatingBankAccountUnlock.bankAccountIDToUnlock, conciergeReportID ?? undefined, initiatingBankAccountUnlock.optimisticReportActionID);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/DynamicReportDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@
(isDefaultRoom && isChatThread && isPolicyEmployee) ||
(!isUserCreatedPolicyRoom && participants.length) ||
(isUserCreatedPolicyRoom && (isPolicyEmployee || (isChatThread && !isPublicRoomUtil(report))))) &&
!isConciergeChatReport(report) &&
!isConciergeChatReport(report, conciergeReportID) &&
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Recompute the details menu when Concierge ID changes

When the Concierge report is opened before ONYXKEYS.CONCIERGE_REPORT_ID has populated, this useMemo can build the menu with isConciergeChatReport(report, undefined) and include the Members item; when the Concierge ID later arrives, the component re-renders but the memo does not because conciergeReportID is not in the dependency list. Add conciergeReportID to the memo dependencies so Concierge-only exclusions are recalculated as the Onyx value loads or changes.

Useful? React with 👍 / 👎.

!isSystemChat &&
activeChatMembers.length > 0
) {
Expand Down Expand Up @@ -626,7 +626,7 @@
}

return items;
}, [

Check failure on line 629 in src/pages/DynamicReportDetailsPage.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

React Hook useMemo has a missing dependency: 'conciergeReportID'. Either include it or remove the dependency array

Check failure on line 629 in src/pages/DynamicReportDetailsPage.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

React Hook useMemo has a missing dependency: 'conciergeReportID'. Either include it or remove the dependency array
isSelfDM,
isArchivedRoom,
isGroupChat,
Expand Down
3 changes: 2 additions & 1 deletion src/pages/ProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ function ProfilePage({route}: ProfilePageProps) {
const reportKey = isAnonymousUserSession() || !reportID ? (`${ONYXKEYS.COLLECTION.REPORT}0` as const) : (`${ONYXKEYS.COLLECTION.REPORT}${reportID}` as const);

const [report] = useOnyx(reportKey);
const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);
const backPath = useDynamicBackPath(DYNAMIC_ROUTES.PROFILE.path);

const styles = useThemeStyles();
Expand Down Expand Up @@ -158,7 +159,7 @@ function ProfilePage({route}: ProfilePageProps) {
const notificationPreference = shouldShowNotificationPreference
? translate(`notificationPreferencesPage.notificationPreferences.${notificationPreferenceValue}` as TranslationPaths)
: '';
const isConcierge = isConciergeChatReport(report);
const isConcierge = isConciergeChatReport(report, conciergeReportID);

// eslint-disable-next-line rulesdir/prefer-early-return
useEffect(() => {
Expand Down
3 changes: 2 additions & 1 deletion src/pages/inbox/AccountManagerBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function AccountManagerBanner({reportID}: AccountManagerBannerProps) {
const {translate} = useLocalize();
const expensifyIcons = useMemoizedLazyExpensifyIcons(['Lightbulb']);
const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(reportID)}`);
const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);
const [accountManagerData] = useOnyx(ONYXKEYS.ACCOUNT, {
selector: (account) => ({
accountManagerReportID: account?.accountManagerReportID,
Expand All @@ -35,7 +36,7 @@ function AccountManagerBanner({reportID}: AccountManagerBannerProps) {
});
const [isBannerVisible, setIsBannerVisible] = useState(true);

if (!accountManagerReportID || !isConciergeChatReport(report) || !isBannerVisible) {
if (!accountManagerReportID || !isConciergeChatReport(report, conciergeReportID) || !isBannerVisible) {
return null;
}
const displayName = getDisplayNameOrDefault(participantPersonalDetail);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/inbox/HeaderView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ function HeaderView({onNavigationMenuButtonClicked, reportID}: HeaderViewProps)
const shouldShowEarlyDiscountBanner = shouldShowDiscount && isChatUsedForOnboarding && !isInSidePanel;
const latestScheduledCall = reportNameValuePairs?.calendlyCalls?.at(-1);
const hasActiveScheduledCall = latestScheduledCall && !isPast(latestScheduledCall.eventTime) && latestScheduledCall.status !== CONST.SCHEDULE_CALL_STATUS.CANCELLED;
const shouldShowCloseButton = !!isInSidePanel && !shouldUseNarrowLayout && isConciergeChatReport(report);
const shouldShowCloseButton = !!isInSidePanel && !shouldUseNarrowLayout && isConciergeChatReport(report, conciergeReportID);
const shouldShowBackButton = (shouldUseNarrowLayout || !!isInSidePanel) && !shouldShowCloseButton;

const onboardingHelpDropdownButton = (
Expand Down
Loading