MM-15912 Fix uploads stuck at 100% (#2847)

This commit is contained in:
Elias Nahum 2019-05-30 14:57:15 -04:00 committed by Miguel Alatzar
parent 163f0b7fdf
commit ad0c3a5ea2

View file

@ -73,15 +73,13 @@ export default class FileUploadItem extends PureComponent {
const {actions, channelId, file, rootId} = this.props;
const response = JSON.parse(res.data);
if (res.respInfo.status === 200 || res.respInfo.status === 201) {
this.setState({progress: 100}, () => {
const data = response.file_infos.map((f) => {
return {
...f,
clientId: file.clientId,
};
});
actions.uploadComplete(data, channelId, rootId);
const data = response.file_infos.map((f) => {
return {
...f,
clientId: file.clientId,
};
});
actions.uploadComplete(data, channelId, rootId);
} else {
actions.uploadFailed([file.clientId], channelId, rootId, response.message);
}