Add error message in post status form when failing to post and don't get rid of post/attachments when failing.

This commit is contained in:
Shpuld Shpuldson 2017-08-20 13:16:41 +03:00
parent fb3408d64f
commit 42fb65e274
3 changed files with 33 additions and 13 deletions

View file

@ -7,12 +7,15 @@ const postStatus = ({ store, status, media = [], inReplyToStatusId = undefined }
return apiService.postStatus({credentials: store.state.users.currentUser.credentials, status, mediaIds, inReplyToStatusId})
.then((data) => data.json())
.then((data) => {
store.dispatch('addNewStatuses', {
statuses: [data],
timeline: 'friends',
showImmediately: true,
noIdUpdate: true // To prevent missing notices on next pull.
})
if (!data.error) {
store.dispatch('addNewStatuses', {
statuses: [data],
timeline: 'friends',
showImmediately: true,
noIdUpdate: true // To prevent missing notices on next pull.
})
}
return data
})
}