From: Thibaut Girka Date: Tue, 5 Mar 2019 21:51:23 +0000 (+0100) Subject: [Glitch] Perform deep comparison for card data when receiving new props X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=ff827c1f38e91f2ef0ac3ee1c92f0f8a1a3cbdfa;p=mastodon.git [Glitch] Perform deep comparison for card data when receiving new props Prevents embedded players from resetting when interacting with the toot --- diff --git a/app/javascript/flavours/glitch/features/status/components/card.js b/app/javascript/flavours/glitch/features/status/components/card.js index e405a5ef0..f974a87a1 100644 --- a/app/javascript/flavours/glitch/features/status/components/card.js +++ b/app/javascript/flavours/glitch/features/status/components/card.js @@ -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 }); } }