@@ -9,19 +9,11 @@ import * as NavigationService from '../nav/NavigationService';
99import * as logging from '../utils/logging' ;
1010import ReactionUserList from './ReactionUserList' ;
1111import { connect } from '../react-redux' ;
12- import type {
13- AggregatedReaction ,
14- Dispatch ,
15- EmojiType ,
16- Message ,
17- ReactionType ,
18- UserOrBot ,
19- } from '../types' ;
12+ import type { AggregatedReaction , Dispatch , EmojiType , Message , ReactionType } from '../types' ;
2013import { Screen , Label , RawLabel } from '../common' ;
2114import { getOwnUser } from '../selectors' ;
2215import aggregateReactions from './aggregateReactions' ;
2316import styles from '../styles' ;
24- import { getAllUsersById } from '../users/userSelectors' ;
2517import { materialTopTabNavigatorConfig } from '../styles/tabs' ;
2618import Emoji from '../emoji/Emoji' ;
2719import { objectFromEntries } from '../jsBackport' ;
@@ -39,16 +31,13 @@ const emojiTypeFromReactionType = (reactionType: ReactionType): EmojiType => {
3931const getReactionsTabs = (
4032 aggregatedReactions : $ReadOnlyArray < AggregatedReaction > ,
4133 reactionName ? : string ,
42- allUsersById : Map < number , UserOrBot > ,
4334) => {
4435 // Each tab corresponds to an aggregated reaction, and has a user list.
4536 const reactionsTabs = objectFromEntries (
4637 aggregatedReactions . map ( aggregatedReaction => [
4738 aggregatedReaction . name ,
4839 {
49- screen : ( ) => (
50- < ReactionUserList reactedUserIds = { aggregatedReaction . users } allUsersById = { allUsersById } />
51- ) ,
40+ screen : ( ) => < ReactionUserList reactedUserIds = { aggregatedReaction . users } /> ,
5241 navigationOptions : {
5342 tabBarLabel : ( ) => (
5443 < View style = { styles . row } >
@@ -100,7 +89,6 @@ const getReactionsTabs = (
10089type SelectorProps = $ReadOnly < { |
10190 message : Message | void ,
10291 ownUserId : number ,
103- allUsersById : Map < number , UserOrBot> ,
10492| } > ;
10593
10694type Props = $ReadOnly < { |
@@ -144,7 +132,7 @@ class MessageReactionList extends PureComponent<Props> {
144132 }
145133
146134 render ( ) {
147- const { message, navigation, ownUserId, allUsersById } = this . props ;
135+ const { message, navigation, ownUserId } = this . props ;
148136 const { reactionName } = navigation . state . params ;
149137
150138 const content : React$Node = ( ( ) => {
@@ -162,7 +150,7 @@ class MessageReactionList extends PureComponent<Props> {
162150 // more than one navigator in the app, and the recommended
163151 // workaround isn't feasible; see discussion at
164152 // https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/Dynamic.20routes.20in.20react-navigation/near/1008268.
165- const TabView = getReactionsTabs ( aggregatedReactions , reactionName , allUsersById ) ;
153+ const TabView = getReactionsTabs ( aggregatedReactions , reactionName ) ;
166154 return (
167155 < View style = { styles . flexed } >
168156 < TabView />
@@ -183,5 +171,4 @@ export default connect<SelectorProps, _, _>((state, props) => ({
183171 // message *can* be undefined; see componentDidUpdate for explanation and handling.
184172 message : ( state . messages [ props . navigation . state . params . messageId ] : Message | void ) ,
185173 ownUserId : getOwnUser ( state ) . user_id ,
186- allUsersById : getAllUsersById ( state ) ,
187174} ) ) ( MessageReactionList ) ;
0 commit comments