mattermost-mobile/app/screens/channel/index.js
Elias Nahum 012eb08fde
Fix infinite skeleton in different use cases and do not scroll to messages already seen (#4304)
* Fix infinite skeleton in different use cases

* Apply suggestions from code review

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

* Update app/utils/teams.js

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2020-05-19 18:54:34 -04:00

42 lines
1.4 KiB
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {loadChannelsForTeam, selectInitialChannel} from '@actions/views/channel';
import {recordLoadTime} from '@actions/views/root';
import {selectDefaultTeam} from '@actions/views/select_team';
import {getCurrentChannelId} from '@mm-redux/selectors/entities/channels';
import {getCurrentTeam} from '@mm-redux/selectors/entities/teams';
import {getTheme} from '@mm-redux/selectors/entities/preferences';
import {shouldShowTermsOfService} from '@mm-redux/selectors/entities/users';
import {getChannelStats} from '@mm-redux/actions/channels';
import Channel from './channel';
function mapStateToProps(state) {
const currentTeam = getCurrentTeam(state);
return {
currentTeamId: currentTeam?.id,
currentChannelId: getCurrentChannelId(state),
teamName: currentTeam?.display_name,
theme: getTheme(state),
showTermsOfService: shouldShowTermsOfService(state),
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
getChannelStats,
loadChannelsForTeam,
selectDefaultTeam,
selectInitialChannel,
recordLoadTime,
}, dispatch),
};
}
export default connect(mapStateToProps, mapDispatchToProps)(Channel);