From f47a125f98acf0d30712429eaa9383a23fde43c1 Mon Sep 17 00:00:00 2001 From: Ugo Giordano Date: Sat, 14 Dec 2024 00:31:32 +0100 Subject: [PATCH] fix 51501 --- src/languages/en.ts | 1 + src/languages/es.ts | 1 + src/libs/actions/Report.ts | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 66a83e719377..49016cb50ff7 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1745,6 +1745,7 @@ const translations = { }, onboarding: { welcome: 'Welcome!', + welcomeSignOffTitle: "It's great to meet you!", explanationModal: { title: 'Welcome to Expensify', description: 'One app to handle your business and personal spend at the speed of chat. Try it out and let us know what you think. Much more to come!', diff --git a/src/languages/es.ts b/src/languages/es.ts index 9c2b8a90f312..1e7fe689e668 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1748,6 +1748,7 @@ const translations = { }, onboarding: { welcome: '¡Bienvenido!', + welcomeSignOffTitle: '¡Es un placer conocerte!', explanationModal: { title: 'Bienvenido a Expensify', description: 'Una aplicación para gestionar en un chat todos los gastos de tu empresa y personales. Inténtalo y dinos qué te parece. ¡Hay mucho más por venir!', diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 7baf66adc5c5..4b6e3f7cab7d 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -3561,10 +3561,19 @@ function prepareOnboardingOptimisticData( reportComment: textComment.commentText, }; + // Sign-off welcome message + const welcomeSignOffComment = ReportUtils.buildOptimisticAddCommentReportAction(Localize.translateLocal('onboarding.welcomeSignOffTitle'), undefined, actorAccountID, 2); + const welcomeSignOffCommentAction: OptimisticAddCommentReportAction = welcomeSignOffComment.reportAction; + const welcomeSignOffMessage = { + reportID: targetChatReportID, + reportActionID: welcomeSignOffCommentAction.reportActionID, + reportComment: welcomeSignOffComment.commentText, + }; + let videoCommentAction: OptimisticAddCommentReportAction | null = null; let videoMessage: AddCommentOrAttachementParams | null = null; if ('video' in data && data.video) { - const videoComment = ReportUtils.buildOptimisticAddCommentReportAction(CONST.ATTACHMENT_MESSAGE_TEXT, undefined, actorAccountID, 2); + const videoComment = ReportUtils.buildOptimisticAddCommentReportAction(CONST.ATTACHMENT_MESSAGE_TEXT, undefined, actorAccountID, 3); videoCommentAction = videoComment.reportAction; videoMessage = { reportID: targetChatReportID, @@ -3796,7 +3805,7 @@ function prepareOnboardingOptimisticData( const optimisticData: OnyxUpdate[] = [...tasksForOptimisticData]; const lastVisibleActionCreated = - tasksData.at(-1)?.completedTaskReportAction?.created ?? tasksData.at(-1)?.taskReportAction.reportAction.created ?? videoCommentAction?.created ?? textCommentAction.created; + tasksData.at(-1)?.completedTaskReportAction?.created ?? tasksData.at(-1)?.taskReportAction.reportAction.created ?? videoCommentAction?.created ?? welcomeSignOffCommentAction.created; optimisticData.push( { @@ -3989,7 +3998,7 @@ function prepareOnboardingOptimisticData( }); } - guidedSetupData.push(...tasksForParameters); + guidedSetupData.push(...tasksForParameters, {type: 'message', ...welcomeSignOffMessage}); return {optimisticData, successData, failureData, guidedSetupData, actorAccountID}; }