diff --git a/src/app/components/SlotSection.jsx b/src/app/components/SlotSection.jsx index 489077f3..341fce36 100644 --- a/src/app/components/SlotSection.jsx +++ b/src/app/components/SlotSection.jsx @@ -34,7 +34,7 @@ export default class SlotSection extends TranslatedComponent { this.sectionId = sectionId; this.sectionName = sectionName; this.ssHeadRef = null; - + this.sectionRefArr = this.props.sectionMenuRefs[this.sectionId] = []; this.sectionRefArr['selectedRef'] = null; this._getSlots = this._getSlots.bind(this); @@ -55,11 +55,11 @@ export default class SlotSection extends TranslatedComponent { // _contextMenu() // componentDidUpdate(prevProps) - /** - * TODO: May either need to send the function to be triggered when Enter key is pressed, or else + /** + * TODO: May either need to send the function to be triggered when Enter key is pressed, or else * may need a separate keyDown handler for each subclass (StandardSlotSection, HardpointSlotSection, etc.) * ex: _keyDown(_keyDownfn, event) - * + * * @param {SyntheticEvent} event KeyDown event */ _keyDown(event) { @@ -85,14 +85,14 @@ export default class SlotSection extends TranslatedComponent { } } } - } + } /** * Set focus on appropriate Slot Section Menu element - * @param {Object} focusPrevProps prevProps for componentDidUpdate() from ...SlotSection.jsx + * @param {Object} focusPrevProps prevProps for componentDidUpdate() from ...SlotSection.jsx * @param {String} firstRef id of the first ref in ...SlotSection.jsx * @param {String} lastRef id of the last ref in ...SlotSection.jsx - * + * */ _handleSectionFocus(focusPrevProps, firstRef, lastRef) { if (this.selectedRefId !== null && this.sectionRefArr[this.selectedRefId]) { @@ -228,6 +228,18 @@ export default class SlotSection extends TranslatedComponent { targetSlot.priority = targetPriority; } this.props.onChange(); + this.props.ship + .updatePowerGenerated() + .updatePowerUsed() + .recalculateMass() + .updateJumpStats() + .recalculateShield() + .recalculateShieldCells() + .recalculateArmour() + .recalculateDps() + .recalculateEps() + .recalculateHps() + .updateMovement(); } } } diff --git a/src/app/shipyard/Ship.js b/src/app/shipyard/Ship.js index a7be5860..c8cbf747 100755 --- a/src/app/shipyard/Ship.js +++ b/src/app/shipyard/Ship.js @@ -484,10 +484,7 @@ export default class Ship { * @param {Object} m The module for which to clear the blueprint */ clearModuleSpecial(m) { - if (m.blueprint) { - m.blueprint.special = null; - } - this.recalculateDps().recalculateHps().recalculateEps(); + this.setModuleSpecial(m, null); } /**