Skip to content

Commit

Permalink
fix 51501
Browse files Browse the repository at this point in the history
  • Loading branch information
ugogiordano committed Dec 13, 2024
1 parent c7b91a4 commit f47a125
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!',
Expand Down
15 changes: 12 additions & 3 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
{
Expand Down Expand Up @@ -3989,7 +3998,7 @@ function prepareOnboardingOptimisticData(
});
}

guidedSetupData.push(...tasksForParameters);
guidedSetupData.push(...tasksForParameters, {type: 'message', ...welcomeSignOffMessage});

return {optimisticData, successData, failureData, guidedSetupData, actorAccountID};
}
Expand Down

0 comments on commit f47a125

Please sign in to comment.