From 4d664f6654d17387be22d9bca2f8c085785c53ca Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 6 Jun 2019 08:39:06 -0400 Subject: [PATCH] Fix file upload not completing (#2866) * Fix file upload not completing * Update snapshots --- app/components/file_upload_preview/file_upload_preview.js | 1 - app/components/file_upload_preview/index.js | 5 ++++- app/components/post_textbox/post_textbox.android.js | 2 -- app/screens/channel/channel.ios.js | 2 +- app/screens/thread/__snapshots__/thread.ios.test.js.snap | 1 - app/screens/thread/thread.ios.js | 1 - 6 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/components/file_upload_preview/file_upload_preview.js b/app/components/file_upload_preview/file_upload_preview.js index 0db0dca9f..a07aa9954 100644 --- a/app/components/file_upload_preview/file_upload_preview.js +++ b/app/components/file_upload_preview/file_upload_preview.js @@ -79,7 +79,6 @@ export default class FileUploadPreview extends PureComponent { files, } = this.props; const {fileSizeWarning, showFileMaxWarning} = this.state; - if ( !fileSizeWarning && !showFileMaxWarning && (channelIsLoading || (!files.length && !filesUploadingForCurrentChannel)) diff --git a/app/components/file_upload_preview/index.js b/app/components/file_upload_preview/index.js index 4e58c81e1..15248cd91 100644 --- a/app/components/file_upload_preview/index.js +++ b/app/components/file_upload_preview/index.js @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; +import {getCurrentChannelId} from 'mattermost-redux/selectors/entities/channels'; import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {getDimensions} from 'app/selectors/device'; @@ -13,12 +14,14 @@ import FileUploadPreview from './file_upload_preview'; function mapStateToProps(state, ownProps) { const {deviceHeight} = getDimensions(state); const currentDraft = ownProps.rootId ? getThreadDraft(state, ownProps.rootId) : getCurrentChannelDraft(state); + const channelId = getCurrentChannelId(state); return { + channelId, channelIsLoading: state.views.channel.loading, deviceHeight, files: currentDraft.files, - filesUploadingForCurrentChannel: checkForFileUploadingInChannel(state, ownProps.channelId, ownProps.rootId), + filesUploadingForCurrentChannel: checkForFileUploadingInChannel(state, channelId, ownProps.rootId), theme: getTheme(state), }; } diff --git a/app/components/post_textbox/post_textbox.android.js b/app/components/post_textbox/post_textbox.android.js index 61f8f622a..e7db1b94b 100644 --- a/app/components/post_textbox/post_textbox.android.js +++ b/app/components/post_textbox/post_textbox.android.js @@ -15,7 +15,6 @@ const AUTOCOMPLETE_MAX_HEIGHT = 200; export default class PostTextBoxAndroid extends PostTextBoxBase { render() { const { - channelId, deactivatedChannel, files, rootId, @@ -31,7 +30,6 @@ export default class PostTextBoxAndroid extends PostTextBoxBase { diff --git a/app/screens/channel/channel.ios.js b/app/screens/channel/channel.ios.js index 3e28b1e26..d53d567de 100644 --- a/app/screens/channel/channel.ios.js +++ b/app/screens/channel/channel.ios.js @@ -53,7 +53,7 @@ export default class ChannelIOS extends ChannelBase { updateNativeScrollView={this.updateNativeScrollView} /> - +