Skip to content

Commit

Permalink
fix: add fall back to the recipient key
Browse files Browse the repository at this point in the history
Co-authored-by: Braden MacDonald <mail@bradenm.com>
  • Loading branch information
ihor-romaniuk and bradenmacdonald committed Dec 3, 2024
1 parent 369a05b commit 9f8ed91
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/bulk-email-tool/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ const RECIPIENTS_DISPLAY_NAMES = {
*/
// eslint-disable-next-line import/prefer-default-export
export const getDisplayTextFromRecipient = (intl, recipient) => (
intl.formatMessage(RECIPIENTS_DISPLAY_NAMES[recipient]) || recipient
const msg = RECIPIENTS_DISPLAY_NAMES[recipient];
return msg ? intl.formatMessage(msg) : recipient; // Fall back to the recipient key if no display name is found.
);

0 comments on commit 9f8ed91

Please sign in to comment.