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