]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Perform deep comparison for card data when receiving new props
authorThibaut Girka <thib@sitedethib.com>
Tue, 5 Mar 2019 21:51:23 +0000 (22:51 +0100)
committerThibG <thib@sitedethib.com>
Tue, 5 Mar 2019 22:22:29 +0000 (23:22 +0100)
Prevents embedded players from resetting when interacting with the toot

app/javascript/flavours/glitch/features/status/components/card.js

index e405a5ef00323dd0c68d99a9556c8d1805a452ee..f974a87a1676ca66d0ef3aa31da9c20c904f45f7 100644 (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 });
     }
   }