[Glitch] Perform deep comparison for card data when receiving new props

Prevents embedded players from resetting when interacting with the toot
This commit is contained in:
Thibaut Girka 2019-03-05 22:51:23 +01:00 committed by ThibG
parent 750b967e86
commit 6ad1fc3254

View file

@ -75,7 +75,7 @@ export default class Card extends React.PureComponent {
};
componentWillReceiveProps (nextProps) {
if (this.props.card !== nextProps.card) {
if (!Immutable.is(this.props.card, nextProps.card)) {
this.setState({ embedded: false });
}
}