mattermost-mobile/app/components/post_draft/uploads/index.js
Elias Nahum f73db6e51c
MM-29948 Display error msg when pasting files and uploads are disabled (#4927)
* MM-29948 Display error msg when pasting files and uploads are disabled

* Remove unnecessary ref and Animated.View

Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2020-10-28 12:06:09 -03:00

35 lines
1.2 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} from '@mm-redux/selectors/entities/general';
import {getDimensions} from '@selectors/device';
import {checkForFileUploadingInChannel} from '@selectors/file';
import {getAllowedServerMaxFileSize} 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),
};
}
const mapDispatchToProps = {
handleRemoveLastFile,
initUploadFiles,
};
export default connect(mapStateToProps, mapDispatchToProps)(Uploads);