Skip to content

Commit

Permalink
Merge pull request #50489 from shubham1206agra/fix-missing-message
Browse files Browse the repository at this point in the history
Show missing shipping details always when assigned user is not same as current user
  • Loading branch information
mountiny authored Oct 21, 2024
2 parents da68c0b + 7e782de commit 4575341
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1781,7 +1781,7 @@ function getCardIssuedMessage(reportAction: OnyxEntry<ReportAction>, shouldRende

const isAssigneeCurrentUser = currentUserAccountID === assigneeAccountID;

const shouldShowAddMissingDetailsButton = reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.CARD_MISSING_ADDRESS && missingDetails && isAssigneeCurrentUser;
const shouldShowAddMissingDetailsMessage = !isAssigneeCurrentUser || (reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.CARD_MISSING_ADDRESS && missingDetails);
switch (reportAction?.actionName) {
case CONST.REPORT.ACTIONS.TYPE.CARD_ISSUED:
return Localize.translateLocal('workspace.expensifyCard.issuedCard', {assignee});
Expand All @@ -1790,7 +1790,7 @@ function getCardIssuedMessage(reportAction: OnyxEntry<ReportAction>, shouldRende
case CONST.REPORT.ACTIONS.TYPE.CARD_ASSIGNED:
return Localize.translateLocal('workspace.companyCards.assignedYouCard', {link: companyCardLink});
case CONST.REPORT.ACTIONS.TYPE.CARD_MISSING_ADDRESS:
return Localize.translateLocal(`workspace.expensifyCard.${shouldShowAddMissingDetailsButton ? 'issuedCardNoShippingDetails' : 'addedShippingDetails'}`, {assignee});
return Localize.translateLocal(`workspace.expensifyCard.${shouldShowAddMissingDetailsMessage ? 'issuedCardNoShippingDetails' : 'addedShippingDetails'}`, {assignee});
default:
return '';
}
Expand Down

0 comments on commit 4575341

Please sign in to comment.