@@ -165,11 +165,6 @@ export default class ReactionsRow extends React.PureComponent<IProps, IState> {
165
165
return null ;
166
166
}
167
167
168
- const cli = this . context . room . client ;
169
- const room = cli . getRoom ( mxEvent . getRoomId ( ) ) ;
170
- const isPeeking = room . getMyMembership ( ) !== "join" ;
171
- const canReact = ! isPeeking && this . context . canReact ;
172
-
173
168
let items = reactions . getSortedAnnotationsByKey ( ) . map ( ( [ content , events ] ) => {
174
169
const count = events . size ;
175
170
if ( ! count ) {
@@ -188,7 +183,7 @@ export default class ReactionsRow extends React.PureComponent<IProps, IState> {
188
183
mxEvent = { mxEvent }
189
184
reactionEvents = { events }
190
185
myReactionEvent = { myReactionEvent }
191
- disabled = { ! canReact }
186
+ disabled = { ! this . context . canReact }
192
187
/> ;
193
188
} ) . filter ( item => ! ! item ) ;
194
189
@@ -197,7 +192,7 @@ export default class ReactionsRow extends React.PureComponent<IProps, IState> {
197
192
// Show the first MAX_ITEMS if there are MAX_ITEMS + 1 or more items.
198
193
// The "+ 1" ensure that the "show all" reveals something that takes up
199
194
// more space than the button itself.
200
- let showAllButton ;
195
+ let showAllButton : JSX . Element ;
201
196
if ( ( items . length > MAX_ITEMS_WHEN_LIMITED + 1 ) && ! showAll ) {
202
197
items = items . slice ( 0 , MAX_ITEMS_WHEN_LIMITED ) ;
203
198
showAllButton = < AccessibleButton
@@ -209,8 +204,8 @@ export default class ReactionsRow extends React.PureComponent<IProps, IState> {
209
204
</ AccessibleButton > ;
210
205
}
211
206
212
- let addReactionButton ;
213
- if ( room . getMyMembership ( ) === "join" && this . context . canReact ) {
207
+ let addReactionButton : JSX . Element ;
208
+ if ( this . context . canReact ) {
214
209
addReactionButton = < ReactButton mxEvent = { mxEvent } reactions = { reactions } /> ;
215
210
}
216
211
0 commit comments