0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-20 07:32:43 +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

@@ -16,8 +16,7 @@ const ListPage = createClass({
{ {
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({

View File

@@ -42,8 +42,7 @@ const UserPage = createClass({
{ {
title : `${usernameWithS} unpublished brews`, title : `${usernameWithS} unpublished brews`,
class : 'unpublished', class : 'unpublished',
brews : brews.private, brews : brews.private
visible : true
} }
); );
} }