Fixed broken notification state in case of missing member

no issue

- Notification was fetching member's first name which caused error in case the member was not logged in
- Adds check for member to exist before fetching first name
This commit is contained in:
Rish 2020-11-18 19:24:25 +05:30
parent 28ed0fb632
commit 11746c1df7

View File

@ -29,8 +29,9 @@ const Styles = () => {
const NotificationText = ({type, status, context}) => {
const signinPortalLink = getPortalLink({page: 'signin', siteUrl: context.site.url});
const singupPortalLink = getPortalLink({page: 'signup', siteUrl: context.site.url});
const firstname = context.member.firstname;
if (type === 'signin' && status === 'success') {
if (type === 'signin' && status === 'success' && context.member) {
const firstname = context.member.firstname || '';
return (
<p>
Welcome back{(firstname ? ', ' + firstname : '')}!<br />You've successfully signed in.