Skip to content

Commit

Permalink
fix: πŸ› improve handling of optional method
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed May 6, 2020
1 parent 1eba4f0 commit d8c525c
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,16 @@ function renderNotifications(
</EuiNotificationBadge>
);

const tooltip = notification.getDisplayNameTooltip!(context);
if (notification.getDisplayNameTooltip) {
const tooltip = notification.getDisplayNameTooltip(context);

if (tooltip) {
badge = (
<EuiToolTip position="top" delay="regular" content={tooltip}>
{badge}
</EuiToolTip>
);
if (tooltip) {
badge = (
<EuiToolTip position="top" delay="regular" content={tooltip}>
{badge}
</EuiToolTip>
);
}
}

return badge;
Expand Down

0 comments on commit d8c525c

Please sign in to comment.