0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-30 02:22:49 +00:00

Remove unnecessary visible from UserPage props

This commit is contained in:
G.Ambatte
2022-09-01 20:06:30 +12:00
parent fc3a599f90
commit 66626b3427
2 changed files with 7 additions and 10 deletions

View File

@@ -14,10 +14,9 @@ const ListPage = createClass({
return {
brewCollection : [
{
title : '',
class : '',
brews : [],
visible : true
title : '',
class : '',
brews : []
}
],
navItems : <></>
@@ -46,8 +45,7 @@ const ListPage = createClass({
// LOAD FROM LOCAL STORAGE
if(typeof window !== 'undefined') {
const brewCollection = this.props.brewCollection.map((brewGroup)=>{
const localVisibility = (localStorage.getItem(`${USERPAGE_KEY_PREFIX}-${brewGroup.class}`) ?? 'true')=='true';
brewGroup.visible = (brewGroup.visible != localVisibility ? localVisibility : brewGroup.visible);
brewGroup.visible = (localStorage.getItem(`${USERPAGE_KEY_PREFIX}-${brewGroup.class}`) ?? 'true')=='true';
return brewGroup;
});
this.setState({

View File

@@ -40,10 +40,9 @@ const UserPage = createClass({
if(this.props.username == global.account?.username){
brewCollection.push(
{
title : `${usernameWithS} unpublished brews`,
class : 'unpublished',
brews : brews.private,
visible : true
title : `${usernameWithS} unpublished brews`,
class : 'unpublished',
brews : brews.private
}
);
}