diff --git a/client/src/components/animations.jsx b/client/src/components/animations.jsx index 84953719..42b640fa 100644 --- a/client/src/components/animations.jsx +++ b/client/src/components/animations.jsx @@ -39,7 +39,6 @@ const Stun = require('./anims/stun'); const Triage = require('./anims/triage'); const TriageTick = require('./anims/triage.tick'); -const actions = require('../actions'); const { removeTier } = require('../utils'); @@ -47,10 +46,16 @@ const addState = connect( function receiveState(state) { const { animTarget } = state; return { animTarget }; - }, + } ); class ConstructAnimation extends Component { + shouldComponentUpdate(nextProps) { + if (nextProps.animTarget !== this.props.animTarget) return true; + if (nextProps.construct !== this.props.construct) return true; + return false; + } + render(props) { const { animTarget, @@ -70,7 +75,7 @@ class ConstructAnimation extends Component { // find target animation - const chooseAnim = (animSkill) => { + const chooseAnim = () => { switch (animSkill) { // Attack base case 'Attack': return ; @@ -124,7 +129,7 @@ class ConstructAnimation extends Component { case 'Reflect': return ; default: return false; - }; + } }; const anim = chooseAnim(animSkill);