RN-198 Fixed adding members to channel not incrementing member count (#635)

* Removed unused props from components

* RN-198 Fixed adding members to channel not incrementing member count

* Updated yarn.lock
This commit is contained in:
Harrison Healey 2017-06-15 11:06:39 -04:00 committed by enahum
parent 92c1e025a8
commit 655a050524
7 changed files with 6 additions and 17 deletions

View file

@ -26,10 +26,8 @@ class ChannelAddMembers extends PureComponent {
intl: intlShape.isRequired,
theme: PropTypes.object.isRequired,
currentChannel: PropTypes.object,
currentChannelMemberCount: PropTypes.number,
membersNotInChannel: PropTypes.array.isRequired,
currentTeam: PropTypes.object,
currentTeamMemberCount: PropTypes.number,
navigator: PropTypes.object,
preferences: PropTypes.object,
loadMoreRequestStatus: PropTypes.string,

View file

@ -6,9 +6,9 @@ import {connect} from 'react-redux';
import {handleAddChannelMembers} from 'app/actions/views/channel_add_members';
import {getTheme} from 'app/selectors/preferences';
import {getCurrentChannel, getCurrentChannelStats} from 'mattermost-redux/selectors/entities/channels';
import {getCurrentChannel} from 'mattermost-redux/selectors/entities/channels';
import {getMyPreferences} from 'mattermost-redux/selectors/entities/preferences';
import {getCurrentTeam, getCurrentTeamStats} from 'mattermost-redux/selectors/entities/teams';
import {getCurrentTeam} from 'mattermost-redux/selectors/entities/teams';
import {getProfilesNotInCurrentChannel} from 'mattermost-redux/selectors/entities/users';
import {getTeamStats} from 'mattermost-redux/actions/teams';
import {getProfilesNotInChannel, searchProfiles} from 'mattermost-redux/actions/users';
@ -16,16 +16,11 @@ import {getProfilesNotInChannel, searchProfiles} from 'mattermost-redux/actions/
import ChannelAddMembers from './channel_add_members';
function mapStateToProps(state) {
const currentTeamMemberCount = getCurrentTeamStats(state) && getCurrentTeamStats(state).total_member_count;
const currentChannelMemberCount = getCurrentChannelStats(state) && getCurrentChannelStats(state).member_count;
return {
theme: getTheme(state),
currentChannel: getCurrentChannel(state),
membersNotInChannel: getProfilesNotInCurrentChannel(state),
currentTeam: getCurrentTeam(state),
currentTeamMemberCount,
currentChannelMemberCount,
preferences: getMyPreferences(state),
loadMoreRequestStatus: state.requests.users.getProfilesNotInChannel.status,
addChannelMemberRequestStatus: state.requests.channels.addChannelMember,

View file

@ -234,7 +234,6 @@ class ChannelInfo extends PureComponent {
<ChannelInfoHeader
createAt={currentChannel.create_at}
creator={currentChannelCreatorName}
memberCount={currentChannelMemberCount}
displayName={currentChannel.display_name}
header={currentChannel.header}
purpose={currentChannel.purpose}

View file

@ -32,7 +32,8 @@ function mapStateToProps(state, ownProps) {
const currentChannel = getCurrentChannel(state);
const currentChannelCreator = getUser(state, currentChannel.creator_id);
const currentChannelCreatorName = currentChannelCreator && currentChannelCreator.username;
const currentChannelMemberCount = getCurrentChannelStats(state) && getCurrentChannelStats(state).member_count;
const currentChannelStats = getCurrentChannelStats(state);
const currentChannelMemberCount = currentChannelStats && currentChannelStats.member_count;
const currentUserId = getCurrentUserId(state);
const favoriteChannels = getChannelsByCategory(state).favoriteChannels.map((f) => f.id);
const isCurrent = currentChannel.id === state.entities.channels.currentChannelId;

View file

@ -28,7 +28,6 @@ class ChannelMembers extends PureComponent {
theme: PropTypes.object.isRequired,
currentChannel: PropTypes.object,
currentChannelMembers: PropTypes.array.isRequired,
currentChannelMemberCount: PropTypes.number.isRequired,
currentUserId: PropTypes.string.isRequired,
navigator: PropTypes.object,
preferences: PropTypes.object,

View file

@ -6,7 +6,7 @@ import {connect} from 'react-redux';
import {handleRemoveChannelMembers} from 'app/actions/views/channel_members';
import {getTheme} from 'app/selectors/preferences';
import {getCurrentChannel, getCurrentChannelStats, canManageChannelMembers} from 'mattermost-redux/selectors/entities/channels';
import {getCurrentChannel, canManageChannelMembers} from 'mattermost-redux/selectors/entities/channels';
import {getMyPreferences} from 'mattermost-redux/selectors/entities/preferences';
import {getProfilesInCurrentChannel} from 'mattermost-redux/selectors/entities/users';
import {getProfilesInChannel, searchProfiles} from 'mattermost-redux/actions/users';
@ -14,13 +14,10 @@ import {getProfilesInChannel, searchProfiles} from 'mattermost-redux/actions/use
import ChannelMembers from './channel_members';
function mapStateToProps(state) {
const currentChannelMemberCount = getCurrentChannelStats(state) && getCurrentChannelStats(state).member_count;
return {
theme: getTheme(state),
currentChannel: getCurrentChannel(state),
currentChannelMembers: getProfilesInCurrentChannel(state),
currentChannelMemberCount,
currentUserId: state.entities.users.currentUserId,
preferences: getMyPreferences(state),
requestStatus: state.requests.users.getProfilesInChannel.status,

View file

@ -3645,7 +3645,7 @@ makeerror@1.0.x:
mattermost-redux@mattermost/mattermost-redux#master:
version "0.0.1"
resolved "https://codeload.github.com/mattermost/mattermost-redux/tar.gz/fe0d67308436b7b501bc63b287f5434180f63a6c"
resolved "https://codeload.github.com/mattermost/mattermost-redux/tar.gz/936aaa53c442c2074c7a85069cf4c4531118c55a"
dependencies:
deep-equal "1.0.1"
harmony-reflect "1.5.1"