mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-16 12:32:39 +00:00
Remove unnecessary visible from UserPage props
This commit is contained in:
@@ -14,10 +14,9 @@ const ListPage = createClass({
|
|||||||
return {
|
return {
|
||||||
brewCollection : [
|
brewCollection : [
|
||||||
{
|
{
|
||||||
title : '',
|
title : '',
|
||||||
class : '',
|
class : '',
|
||||||
brews : [],
|
brews : []
|
||||||
visible : true
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
navItems : <></>
|
navItems : <></>
|
||||||
@@ -46,8 +45,7 @@ const ListPage = createClass({
|
|||||||
// LOAD FROM LOCAL STORAGE
|
// LOAD FROM LOCAL STORAGE
|
||||||
if(typeof window !== 'undefined') {
|
if(typeof window !== 'undefined') {
|
||||||
const brewCollection = this.props.brewCollection.map((brewGroup)=>{
|
const brewCollection = this.props.brewCollection.map((brewGroup)=>{
|
||||||
const localVisibility = (localStorage.getItem(`${USERPAGE_KEY_PREFIX}-${brewGroup.class}`) ?? 'true')=='true';
|
brewGroup.visible = (localStorage.getItem(`${USERPAGE_KEY_PREFIX}-${brewGroup.class}`) ?? 'true')=='true';
|
||||||
brewGroup.visible = (brewGroup.visible != localVisibility ? localVisibility : brewGroup.visible);
|
|
||||||
return brewGroup;
|
return brewGroup;
|
||||||
});
|
});
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|||||||
@@ -40,10 +40,9 @@ const UserPage = createClass({
|
|||||||
if(this.props.username == global.account?.username){
|
if(this.props.username == global.account?.username){
|
||||||
brewCollection.push(
|
brewCollection.push(
|
||||||
{
|
{
|
||||||
title : `${usernameWithS} unpublished brews`,
|
title : `${usernameWithS} unpublished brews`,
|
||||||
class : 'unpublished',
|
class : 'unpublished',
|
||||||
brews : brews.private,
|
brews : brews.private
|
||||||
visible : true
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user