Fixed startup issue.
This commit is contained in:
parent
73db7e5074
commit
95143d8034
|
@ -24,7 +24,7 @@ const styles = theme => ({
|
|||
backgroundColor: 'black',
|
||||
marginTop: 20,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
class FlameLinkCollectionGallery extends Component {
|
||||
constructor(props) {
|
||||
|
@ -39,7 +39,7 @@ class FlameLinkCollectionGallery extends Component {
|
|||
schemaDescription: '',
|
||||
}
|
||||
|
||||
flamelinkApp.schemas.getFields(this.props.galleryName, { fields: [ 'title', 'key', 'type', 'gridColumns', 'description', 'options'] })
|
||||
flamelinkApp.schemas.getFields(this.props.galleryName, { fields: ['title', 'key', 'type', 'gridColumns', 'description', 'options'] })
|
||||
.then(result => this.setState({
|
||||
schemaDetails: result
|
||||
}))
|
||||
|
@ -49,9 +49,8 @@ class FlameLinkCollectionGallery extends Component {
|
|||
schemaContent: result
|
||||
}))
|
||||
|
||||
if(this.props.showTitle === false){
|
||||
}
|
||||
else{
|
||||
if (this.props.showTitle === false) {
|
||||
} else {
|
||||
flamelinkApp.schemas.get(this.props.galleryName)
|
||||
.then(result => this.setState({
|
||||
schemaDescription: result.title
|
||||
|
@ -59,31 +58,31 @@ class FlameLinkCollectionGallery extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
getGalleryInfo(schemaDetails, schemaContent){
|
||||
getGalleryInfo(schemaDetails, schemaContent) {
|
||||
var key;
|
||||
var mediaNums = []
|
||||
for (var val in schemaDetails){
|
||||
for (var val in schemaDetails) {
|
||||
key = schemaDetails[val].key
|
||||
}
|
||||
for (var val1 in schemaContent){
|
||||
for (var val2 in schemaContent[val1][key]){
|
||||
for (var val1 in schemaContent) {
|
||||
for (var val2 in schemaContent[val1][key]) {
|
||||
global.mediaIDs.push(schemaContent[val1][key][val2]);
|
||||
}
|
||||
}
|
||||
for (var val3 in global.mediaIDs){
|
||||
for (var val3 in global.mediaIDs) {
|
||||
mediaNums.push(val3)
|
||||
}
|
||||
return mediaNums.map(this.createGallery);
|
||||
}
|
||||
|
||||
createGallery(num){
|
||||
return <FlameLinkCollectionGalleryContent num={num} key={global.mediaIDs[num]}/>
|
||||
createGallery(num) {
|
||||
return <FlameLinkCollectionGalleryContent num={num} key={global.mediaIDs[num]} />
|
||||
}
|
||||
|
||||
render() {
|
||||
const { classes } = this.props;
|
||||
|
||||
return(
|
||||
return (
|
||||
<Grid container>
|
||||
{this.getGalleryInfo(this.state.schemaDetails, this.state.schemaContent)}
|
||||
<Typography variant='display3' className={classes.flamelinkItem}>
|
||||
|
@ -91,7 +90,7 @@ class FlameLinkCollectionGallery extends Component {
|
|||
</Typography>
|
||||
<Grid container className={classes.flamelinkGalleryContainer}>
|
||||
<Grid item lg={8} md={8} sm={12} xs={12} className={classes.flamelinkGallery} >
|
||||
<RenderGallery/>
|
||||
<RenderGallery key={Math.random()} />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
|
Loading…
Reference in New Issue