From 3624a4a6b6f76440f7d5cbd558c8d47ef5c27599 Mon Sep 17 00:00:00 2001 From: Pedro Guerreiro Date: Fri, 19 Jul 2024 15:47:10 +0100 Subject: [PATCH 1/2] fix: multiple chat reports picked for onboarding --- src/libs/ReportUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 1922d304a0c5..d224120eba1a 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -7089,8 +7089,8 @@ function shouldShowMerchantColumn(transactions: Transaction[]) { */ function isChatUsedForOnboarding(optionOrReport: OnyxEntry | OptionData): boolean { // onboarding can be an array for old accounts and accounts created from olddot - if (!Array.isArray(onboarding) && onboarding?.chatReportID === optionOrReport?.reportID) { - return true; + if (onboarding && !Array.isArray(onboarding) && onboarding.chatReportID && optionOrReport?.chatReportID) { + return onboarding.chatReportID === optionOrReport.chatReportID; } return AccountUtils.isAccountIDOddNumber(currentUserAccountID ?? -1) From 57091eadf358f927d47dfc020752faa8704f2874 Mon Sep 17 00:00:00 2001 From: Pedro Guerreiro Date: Mon, 29 Jul 2024 17:26:47 +0100 Subject: [PATCH 2/2] fix: apply suggestions --- src/libs/ReportUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index d5b46a445f7e..9fa60613ab92 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -7193,8 +7193,8 @@ function shouldShowMerchantColumn(transactions: Transaction[]) { */ function isChatUsedForOnboarding(optionOrReport: OnyxEntry | OptionData): boolean { // onboarding can be an array for old accounts and accounts created from olddot - if (onboarding && !Array.isArray(onboarding) && onboarding.chatReportID && optionOrReport?.chatReportID) { - return onboarding.chatReportID === optionOrReport.chatReportID; + if (onboarding && !Array.isArray(onboarding) && onboarding.chatReportID) { + return onboarding.chatReportID === optionOrReport?.reportID; } return AccountUtils.isAccountIDOddNumber(currentUserAccountID ?? -1)