Fixed some issues
This commit is contained in:
@@ -17,8 +17,10 @@ class Equipment extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
let display = this.flattenStructure(this.state, this.props.scientists);
|
||||
|
||||
//if there are no scientists
|
||||
if (this.props.scientists <= 0) {
|
||||
if (this.props.scientists <= 0 && display.length === 0) {
|
||||
return (
|
||||
<div className='panel'>
|
||||
<p className='centered'>You have no scientists!</p>
|
||||
@@ -27,8 +29,6 @@ class Equipment extends React.Component {
|
||||
);
|
||||
}
|
||||
|
||||
let display = this.flattenStructure(this.state, this.props.scientists);
|
||||
|
||||
return (
|
||||
<div className='panel'>
|
||||
<div className='table'>
|
||||
@@ -91,13 +91,13 @@ class Equipment extends React.Component {
|
||||
|
||||
Object.keys(structure.statistics).map((type) => {
|
||||
Object.keys(structure.statistics[type]).map((name) => {
|
||||
//don't render high level items
|
||||
if (structure.statistics[type][name].scientistsRequired > scientists) {
|
||||
//don't render high level items you don't own
|
||||
if (structure.statistics[type][name].scientistsRequired > scientists && !structure.owned[name]) {
|
||||
return;
|
||||
}
|
||||
|
||||
//if you can't buy it and you down own it, don't render it (for legendary items)
|
||||
if (!structure.statistics[type][name].purchasable && !structure.owned[name]) {
|
||||
//if you can't see it and you don't own it, don't render it (for legendary items)
|
||||
if (!structure.statistics[type][name].visible && !structure.owned[name]) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -106,7 +106,8 @@ class Equipment extends React.Component {
|
||||
name: name,
|
||||
type: type,
|
||||
owned: (structure.owned && structure.owned[name]) || 0,
|
||||
...structure.statistics[type][name]
|
||||
...structure.statistics[type][name],
|
||||
purchasable: structure.statistics[type][name].purchasable && structure.statistics[type][name].scientistsRequired <= scientists //negate purchasing of too-high-level items
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user