Fix file upload not completing (#2866)

* Fix file upload not completing

* Update snapshots
This commit is contained in:
Elias Nahum
2019-06-06 08:39:06 -04:00
parent ddbc89bb9a
commit a05d11635e
6 changed files with 5 additions and 7 deletions

View File

@@ -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))

View File

@@ -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),
};
}

View File

@@ -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 {
<React.Fragment>
<Typing/>
<FileUploadPreview
channelId={channelId}
files={files}
rootId={rootId}
/>

View File

@@ -53,7 +53,7 @@ export default class ChannelIOS extends ChannelBase {
updateNativeScrollView={this.updateNativeScrollView}
/>
<View nativeID={ACCESSORIES_CONTAINER_NATIVE_ID}>
<FileUploadPreview channelId={currentChannelId}/>
<FileUploadPreview/>
<Autocomplete
maxHeight={AUTOCOMPLETE_MAX_HEIGHT}
onChangeText={this.handleAutoComplete}

View File

@@ -56,7 +56,6 @@ exports[`thread should match snapshot, has root post 1`] = `
nativeID="threadAccessoriesContainer"
>
<Connect(FileUploadPreview)
channelId="channel_id"
rootId="root_id"
/>
<ForwardRef(forwardConnectRef)

View File

@@ -54,7 +54,6 @@ export default class ThreadIOS extends ThreadBase {
/>
<View nativeID={ACCESSORIES_CONTAINER_NATIVE_ID}>
<FileUploadPreview
channelId={channelId}
rootId={rootId}
/>
<Autocomplete