fix construct img reloads
This commit is contained in:
parent
9f0c212643
commit
3f1367172d
@ -71,7 +71,6 @@ function createSocket(store) {
|
||||
|
||||
// set the game state so resolutions don't fire twice
|
||||
store.dispatch(actions.setGame(game));
|
||||
ws.sendGameState(game.id);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
@ -70,10 +70,6 @@ class Sleep extends Component {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
anime.set('#sleep', {
|
||||
translateY: 75,
|
||||
});
|
||||
|
||||
this.animations.push(anime({
|
||||
targets: ['#sleep'],
|
||||
opacity: [
|
||||
|
||||
@ -113,6 +113,10 @@ class ConstructAvatar extends Component {
|
||||
}
|
||||
|
||||
shouldComponentUpdate({ animSource, animTarget, construct }) {
|
||||
if (construct !== this.props.construct) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (animSource === this.props.animSource && animTarget === this.props.animTarget) {
|
||||
// console.warn(construct.name, 'thinks its same props')
|
||||
return false;
|
||||
|
||||
@ -78,7 +78,7 @@ function registerEvents(store) {
|
||||
store.dispatch(actions.setAnimSource(null));
|
||||
store.dispatch(actions.setAnimTarget(null));
|
||||
store.dispatch(actions.setAnimText(null));
|
||||
return setTimeout(cb, 50);
|
||||
return cb();
|
||||
}, timeout);
|
||||
|
||||
}, err => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user