forked from Ivasoft/mattermost-mobile
Fix file upload not completing (#2866)
* Fix file upload not completing * Update snapshots
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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}
|
||||
/>
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -54,7 +54,6 @@ export default class ThreadIOS extends ThreadBase {
|
||||
/>
|
||||
<View nativeID={ACCESSORIES_CONTAINER_NATIVE_ID}>
|
||||
<FileUploadPreview
|
||||
channelId={channelId}
|
||||
rootId={rootId}
|
||||
/>
|
||||
<Autocomplete
|
||||
|
||||
Reference in New Issue
Block a user