mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-15 08:22:43 +00:00
Fix crash; props need props.var to work
This commit is contained in:
@@ -22,10 +22,10 @@ const UserPage = (props)=>{
|
|||||||
...props
|
...props
|
||||||
};
|
};
|
||||||
|
|
||||||
const [currentError, setCurrentError] = useState(error || null);
|
const [currentError, setCurrentError] = useState(props.error || null);
|
||||||
|
|
||||||
const usernameWithS = username + (username.endsWith('s') ? `’` : `’s`);
|
const usernameWithS = props.username + (props.username.endsWith('s') ? `’` : `’s`);
|
||||||
const groupedBrews = _.groupBy(brews, (brew)=>brew.published ? 'published' : 'private');
|
const groupedBrews = _.groupBy(props.brews, (brew)=>brew.published ? 'published' : 'private');
|
||||||
|
|
||||||
const brewCollection = [
|
const brewCollection = [
|
||||||
{
|
{
|
||||||
@@ -33,7 +33,7 @@ const UserPage = (props)=>{
|
|||||||
class : 'published',
|
class : 'published',
|
||||||
brews : groupedBrews.published || []
|
brews : groupedBrews.published || []
|
||||||
},
|
},
|
||||||
...(username === global.account?.username ? [{
|
...(props.username === global.account?.username ? [{
|
||||||
title : `${usernameWithS} unpublished brews`,
|
title : `${usernameWithS} unpublished brews`,
|
||||||
class : 'unpublished',
|
class : 'unpublished',
|
||||||
brews : groupedBrews.private || []
|
brews : groupedBrews.private || []
|
||||||
@@ -54,7 +54,7 @@ const UserPage = (props)=>{
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ListPage brewCollection={brewCollection} navItems={navItems} query={query} reportError={(error)=>setCurrentError(error)} />
|
<ListPage brewCollection={brewCollection} navItems={navItems} query={props.query} reportError={(err)=>setCurrentError(err)} />
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user