Fix uploaded files being previewed on wrong channels (#2860)

Этот коммит содержится в:
Joram Wilander
2016-05-03 11:00:06 -04:00
родитель 3a17fd86a0
Коммит 05a203b409
2 изменённых файлов: 13 добавлений и 9 удалений

Просмотреть файл

@@ -49,15 +49,15 @@ class FileUpload extends React.Component {
fileUploadSuccess(channelId, data) {
this.props.onFileUpload(data.filenames, data.client_ids, channelId);
const requests = JSON.parse(JSON.stringify(this.state.requests));
const requests = Object.assign({}, this.state.requests);
for (var j = 0; j < data.client_ids.length; j++) {
Reflect.deleteProperty(requests, data.client_ids[j]);
}
this.setState({requests});
}
fileUploadFail(clientId, err) {
this.props.onUploadError(err, clientId);
fileUploadFail(clientId, channelId, err) {
this.props.onUploadError(err, clientId, channelId);
}
uploadFiles(files) {
@@ -86,7 +86,7 @@ class FileUpload extends React.Component {
channelId,
clientId,
this.fileUploadSuccess.bind(this, channelId),
this.fileUploadFail.bind(this, clientId)
this.fileUploadFail.bind(this, clientId, channelId)
);
const requests = this.state.requests;