fixed rendering bug with non exisiting cards

This commit is contained in:
Daniel
2019-03-26 03:50:29 -04:00
parent 1961edd7b7
commit ccad64bc23
4 changed files with 11 additions and 19 deletions

View File

@@ -47,13 +47,12 @@ export default class SingleAttack extends React.Component {
/>
);
}
else {
else if (card_data) {
if (card_data.gsx$splash) {
return (<Single card={card_data}/>);
}
else {
return(<PageNotFound location={this.props.location}/>);
}
}
return(<PageNotFound location={this.props.location}/>);
}
}

View File

@@ -25,7 +25,6 @@ export default class SingleBattlegear extends React.Component {
const battlegear = API.portal.battlegear.findOne({'gsx$name': name});
const card_data = API.cards.battlegear.findOne({'gsx$name': name});
if (battlegear) {
return (<Single
card={card_data}
@@ -51,12 +50,8 @@ export default class SingleBattlegear extends React.Component {
if (card_data.gsx$splash) {
return (<Single card={card_data}/>);
}
else {
return(<PageNotFound location={this.props.location}/>);
}
}
else {
return(<PageNotFound location={this.props.location}/>);
}
return(<PageNotFound location={this.props.location}/>);
}
}

View File

@@ -49,7 +49,7 @@ export default class SingleLocation extends React.Component {
</React.Fragment>}
/>);
}
else {
else if (card_data) {
if (card_data.gsx$splash) {
return (<Single
card={card_data}
@@ -61,9 +61,8 @@ export default class SingleLocation extends React.Component {
</React.Fragment>}
/>);
}
else {
return(<PageNotFound location={this.props.location}/>);
}
}
return(<PageNotFound location={this.props.location}/>);
}
}

View File

@@ -68,7 +68,7 @@ export default class SingleMugic extends React.Component {
</React.Fragment>}
/>);
}
else {
else if (card_data) {
if (card_data.gsx$splash) {
return (<Single
card={card_data}
@@ -85,9 +85,8 @@ export default class SingleMugic extends React.Component {
</React.Fragment>}
/>);
}
else {
return(<PageNotFound location={this.props.location}/>);
}
}
return(<PageNotFound location={this.props.location}/>);
}
}