This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
src/components/views/messages Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -37,18 +37,24 @@ export default class ReactionDimension extends React.PureComponent {
37
37
} ;
38
38
39
39
if ( props . reactions ) {
40
+ props . reactions . on ( "Relations.add" , this . onReactionsChange ) ;
40
41
props . reactions . on ( "Relations.redaction" , this . onReactionsChange ) ;
41
42
}
42
43
}
43
44
44
45
componentWillReceiveProps ( nextProps ) {
45
46
if ( this . props . reactions !== nextProps . reactions ) {
47
+ nextProps . reactions . on ( "Relations.add" , this . onReactionsChange ) ;
46
48
nextProps . reactions . on ( "Relations.redaction" , this . onReactionsChange ) ;
47
49
}
48
50
}
49
51
50
52
componentWillUnmount ( ) {
51
53
if ( this . props . reactions ) {
54
+ this . props . reactions . removeListener (
55
+ "Relations.add" ,
56
+ this . onReactionsChange ,
57
+ ) ;
52
58
this . props . reactions . removeListener (
53
59
"Relations.redaction" ,
54
60
this . onReactionsChange ,
Original file line number Diff line number Diff line change @@ -32,18 +32,24 @@ export default class ReactionsRow extends React.PureComponent {
32
32
super ( props ) ;
33
33
34
34
if ( props . reactions ) {
35
+ props . reactions . on ( "Relations.add" , this . onReactionsChange ) ;
35
36
props . reactions . on ( "Relations.redaction" , this . onReactionsChange ) ;
36
37
}
37
38
}
38
39
39
40
componentWillReceiveProps ( nextProps ) {
40
41
if ( this . props . reactions !== nextProps . reactions ) {
42
+ nextProps . reactions . on ( "Relations.add" , this . onReactionsChange ) ;
41
43
nextProps . reactions . on ( "Relations.redaction" , this . onReactionsChange ) ;
42
44
}
43
45
}
44
46
45
47
componentWillUnmount ( ) {
46
48
if ( this . props . reactions ) {
49
+ this . props . reactions . removeListener (
50
+ "Relations.add" ,
51
+ this . onReactionsChange ,
52
+ ) ;
47
53
this . props . reactions . removeListener (
48
54
"Relations.redaction" ,
49
55
this . onReactionsChange ,
You can’t perform that action at this time.
0 commit comments