Skip to content

Commit

Permalink
fix(Shields): Standardizes the way that single shields are labelled. C…
Browse files Browse the repository at this point in the history
…loses #2403
  • Loading branch information
alexanderson1993 committed Jul 12, 2019
1 parent b9f7fca commit c0164e0
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion client/src/components/views/DamageControl/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class DamageControlCore extends Component {
return obj;
}
systemName(sys) {
if (sys.type === "Shield") {
if (sys.type === "Shield" && sys.name !== "Shields") {
return `${sys.name} Shields`;
}
return sys.displayName || sys.name;
Expand Down
3 changes: 1 addition & 2 deletions client/src/components/views/DamageControl/damageControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,9 @@ class DamageControl extends Component {
];
};
systemName(sys) {
if (sys.type === "Shield") {
if (sys.type === "Shield" && sys.name !== "Shields") {
return `${sys.name} Shields`;
}

return sys.displayName || sys.name;
}
selectSystem(id) {
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/views/DamageControl/reportsCore.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class DamageReportCore extends Component {
return obj;
}
systemName(sys) {
if (sys.type === "Shield") {
if (sys.type === "Shield" && sys.name !== "Shields") {
return `${sys.name} Shields`;
}
return sys.displayName || sys.name;
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/views/StealthField/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class StealthFieldCore extends Component {
clearTimeout(this.timeout);
}
systemName(sys) {
if (sys.type === "Shield") {
if (sys.type === "Shield" && sys.name !== "Shields") {
return `${sys.name} Shields`;
}
return sys.displayName || sys.name;
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/views/StealthField/stealthBars.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Transitioner from "../helpers/transitioner";

export default class StealthBars extends Transitioner {
systemName(sys) {
if (sys.type === "Shield") {
if (sys.type === "Shield" && sys.name !== "Shields") {
return `${sys.name} Shields`;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const SYSTEMS_SUB = gql`

class DamageMonitoring extends Component {
systemName(sys) {
if (sys.type === "Shield") {
if (sys.type === "Shield" && sys.name !== "Shields") {
return `${sys.name} Shields`;
}
return sys.displayName || sys.name;
Expand Down
4 changes: 3 additions & 1 deletion server/src/classes/shield.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export default class Shield extends System {
this.name = params.name || "Full";
this.displayName =
params.displayName ||
(this.name === "Full" ? "Shields" : this.name + " Shields");
(this.name === "Full" || this.name === "Shields"
? "Shields"
: this.name + " Shields");
// One of '0,1,2,3,4,5,6'
this.position = params.position || 0;
this.frequency = params.frequency || 260.5;
Expand Down

0 comments on commit c0164e0

Please sign in to comment.