Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Fix page error when no notification message #452

Merged
merged 1 commit into from
Aug 26, 2022

Conversation

Emily-Ke
Copy link
Contributor

Pull request checklist:

  • Features and bugfixes should be PRed into the develop branch, not main
  • All text is internationalized
  • There are no linter errors
  • New features support all states (loading, error, etc) No new features

Which JIRA ticket(s) and/or GitHub issues does this PR address?


Pull Request Overview

  • On the notifications page, returns null instead of formatted text if there is no notification message. This prevents react-intl from throwing an uncaught error when undefined is passed to id

</Text>
);
const notificationText =
currentNotificationSchema?.notificationMessage ? (
Copy link
Contributor Author

@Emily-Ke Emily-Ke Aug 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost all of this diff is formatting caused by adding this line. Everything was indented because of this.

>
{intl.formatMessage(
{
id: currentNotificationSchema.notificationMessage,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the one other change. I removed the optional chaining operator because the new condition above that determines if this code should be run is that currentNotificationSchema.notificationMessage exists.

@Emily-Ke Emily-Ke marked this pull request as ready for review August 26, 2022 20:50
@Emily-Ke Emily-Ke requested a review from brmscheiner August 26, 2022 20:50
@Emily-Ke Emily-Ke merged commit a0539ff into develop Aug 26, 2022
@Emily-Ke Emily-Ke deleted the fix-notification-error-when-no-message branch August 26, 2022 21:43
@Atticus29 Atticus29 mentioned this pull request Oct 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants