Этот коммит содержится в:
Asaad Mahmood
2016-03-08 15:07:43 +05:00
родитель 81ccfca2bf
Коммит cc453a048d
41 изменённых файлов: 744 добавлений и 695 удалений

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

@@ -130,7 +130,7 @@ class CreatePost extends React.Component {
post.message,
false,
(data) => {
PostStore.storeDraft(data.channel_id, null);
PostStore.storeDraft(this.state.channelId, null);
this.setState({messageText: '', submitting: false, postError: null, previews: [], serverError: null});
if (data.goto_location && data.goto_location.length > 0) {
@@ -262,9 +262,7 @@ class CreatePost extends React.Component {
message = err.message;
}
if (clientId === -1) {
this.setState({serverError: message});
} else {
if (clientId !== -1) {
const draft = PostStore.getDraft(this.state.channelId);
const index = draft.uploadsInProgress.indexOf(clientId);
@@ -274,8 +272,10 @@ class CreatePost extends React.Component {
PostStore.storeDraft(this.state.channelId, draft);
this.setState({uploadsInProgress: draft.uploadsInProgress, serverError: message});
this.setState({uploadsInProgress: draft.uploadsInProgress});
}
this.setState({serverError: message});
}
removePreview(id) {
const previews = Object.assign([], this.state.previews);