Skip to content

Commit a15c00e

Browse files
committed
UserList: Make props exact; cut ignored ownEmail in callers.
This prop hasn't been used since 72acf9e in mid-2017. Making the props type exact caused Flow to be able to point out that the callers shouldn't be trying to pass it.
1 parent 61d2e34 commit a15c00e

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

src/user-picker/UserPickerCard.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { IconDone } from '../common/Icons';
1010
import UserList from '../users/UserList';
1111
import AvatarList from './AvatarList';
1212
import AnimatedScaleComponent from '../animation/AnimatedScaleComponent';
13-
import { getOwnEmail, getPresence, getUsersSansMe } from '../selectors';
13+
import { getPresence, getUsersSansMe } from '../selectors';
1414

1515
const styles = StyleSheet.create({
1616
wrapper: {
@@ -27,7 +27,6 @@ const styles = StyleSheet.create({
2727
});
2828

2929
type Props = {|
30-
ownEmail: string,
3130
users: User[],
3231
presences: PresenceState,
3332
filter: string,
@@ -89,7 +88,7 @@ class UserPickerCard extends PureComponent<Props, State> {
8988
};
9089

9190
render() {
92-
const { filter, ownEmail, users, presences } = this.props;
91+
const { filter, users, presences } = this.props;
9392
const { selected } = this.state;
9493
return (
9594
<View style={styles.wrapper}>
@@ -105,7 +104,6 @@ class UserPickerCard extends PureComponent<Props, State> {
105104
{selected.length > 0 && <LineSeparator />}
106105
<UserList
107106
style={styles.list}
108-
ownEmail={ownEmail}
109107
filter={filter}
110108
users={users}
111109
presences={presences}
@@ -126,7 +124,6 @@ class UserPickerCard extends PureComponent<Props, State> {
126124
}
127125

128126
export default connect((state: GlobalState) => ({
129-
ownEmail: getOwnEmail(state),
130127
users: getUsersSansMe(state),
131128
presences: getPresence(state),
132129
}))(UserPickerCard);

src/users/UserList.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ const styles = StyleSheet.create({
1313
},
1414
});
1515

16-
type Props = {
16+
type Props = {|
1717
style?: Style,
1818
filter: string,
1919
users: User[],
2020
selected: User[],
2121
presences: PresenceState,
2222
onPress: ({ email: string, fullName: string }) => void,
23-
};
23+
|};
2424

2525
export default class UserList extends PureComponent<Props> {
2626
static defaultProps = {

src/users/UsersCard.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ import React, { PureComponent } from 'react';
66
import type { Dispatch, GlobalState, PresenceState, User } from '../types';
77
import { privateNarrow } from '../utils/narrow';
88
import UserList from './UserList';
9-
import { getOwnEmail, getUsers, getPresence } from '../selectors';
9+
import { getUsers, getPresence } from '../selectors';
1010
import { navigateBack, doNarrow } from '../actions';
1111

1212
type Props = {|
1313
dispatch: Dispatch,
14-
ownEmail: string,
1514
users: User[],
1615
filter: string,
1716
presences: PresenceState,
@@ -25,10 +24,9 @@ class UsersCard extends PureComponent<Props> {
2524
};
2625

2726
render() {
28-
const { ownEmail, users, filter, presences } = this.props;
27+
const { users, filter, presences } = this.props;
2928
return (
3029
<UserList
31-
ownEmail={ownEmail}
3230
users={users}
3331
filter={filter}
3432
presences={presences}
@@ -39,7 +37,6 @@ class UsersCard extends PureComponent<Props> {
3937
}
4038

4139
export default connect((state: GlobalState) => ({
42-
ownEmail: getOwnEmail(state),
4340
users: getUsers(state),
4441
presences: getPresence(state),
4542
}))(UsersCard);

0 commit comments

Comments
 (0)