fix(notifications) Fix case when description is react component instance (#13919)

pull/13923/head jitsi-meet_9013
Horatiu Muresan 2 years ago committed by GitHub
parent a7af01b9e3
commit a4d3fb6c70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      react/features/notifications/components/web/Notification.tsx

@ -208,7 +208,7 @@ const Notification = ({
descriptionKey
&& descriptionArray.push(t(descriptionKey, descriptionArguments));
description && descriptionArray.push(description);
description && typeof description === 'string' && descriptionArray.push(description);
// Keeping in mind that:
// - Notifications that use the `translateToHtml` function get an element-based description array with one entry
@ -219,11 +219,12 @@ const Notification = ({
// the id is used for testing the UI
return (
<p
<div
className = { classes.description }
data-testid = { descriptionKey } >
{shouldRenderHtml ? descriptionArray : <Message text = { descriptionArray.join(' ') } />}
</p>
{typeof description === 'object' && description}
</div>
);
}, [ description, descriptionArguments, descriptionKey, classes ]);

Loading…
Cancel
Save