diff --git a/client/homebrew/pages/userPage/userPage.jsx b/client/homebrew/pages/userPage/userPage.jsx index 975e475a2..5e28051ea 100644 --- a/client/homebrew/pages/userPage/userPage.jsx +++ b/client/homebrew/pages/userPage/userPage.jsx @@ -22,10 +22,10 @@ const UserPage = (props)=>{ ...props }; - const [currentError, setCurrentError] = useState(error || null); + const [currentError, setCurrentError] = useState(props.error || null); - const usernameWithS = username + (username.endsWith('s') ? `’` : `’s`); - const groupedBrews = _.groupBy(brews, (brew)=>brew.published ? 'published' : 'private'); + const usernameWithS = props.username + (props.username.endsWith('s') ? `’` : `’s`); + const groupedBrews = _.groupBy(props.brews, (brew)=>brew.published ? 'published' : 'private'); const brewCollection = [ { @@ -33,7 +33,7 @@ const UserPage = (props)=>{ class : 'published', brews : groupedBrews.published || [] }, - ...(username === global.account?.username ? [{ + ...(props.username === global.account?.username ? [{ title : `${usernameWithS} unpublished brews`, class : 'unpublished', brews : groupedBrews.private || [] @@ -54,7 +54,7 @@ const UserPage = (props)=>{ ); return ( - setCurrentError(error)} /> + setCurrentError(err)} /> ); };