mattermost-mobile/app/components/post_draft/uploads/index.js
Claudio Costa 846aa759b2
[MM-31257] Bump max allowed file uploads per post (#5552)
* Bump max allowed file uploads per post

* Update error string
2021-08-24 18:23:38 +02:00

36 lines
1.3 KiB
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {connect} from 'react-redux';
import {handleRemoveLastFile, initUploadFiles} from '@actions/views/file_upload';
import {getCurrentChannelId} from '@mm-redux/selectors/entities/channels';
import {canUploadFilesOnMobile, getConfig, getServerVersion} from '@mm-redux/selectors/entities/general';
import {getDimensions} from '@selectors/device';
import {checkForFileUploadingInChannel} from '@selectors/file';
import {getAllowedServerMaxFileSize, getMaxFileCount} from '@utils/file';
import Uploads from './uploads';
function mapStateToProps(state, ownProps) {
const {deviceHeight} = getDimensions(state);
const channelId = getCurrentChannelId(state);
const config = getConfig(state);
return {
canUploadFiles: canUploadFilesOnMobile(state),
channelId,
channelIsLoading: state.views.channel.loading,
deviceHeight,
filesUploadingForCurrentChannel: checkForFileUploadingInChannel(state, channelId, ownProps.rootId),
maxFileSize: getAllowedServerMaxFileSize(config),
maxFileCount: getMaxFileCount(getServerVersion(state)),
};
}
const mapDispatchToProps = {
handleRemoveLastFile,
initUploadFiles,
};
export default connect(mapStateToProps, mapDispatchToProps)(Uploads);