fix post status for error handling
This commit is contained in:
parent
ce032ace4c
commit
7bc74083d0
1 changed files with 9 additions and 7 deletions
|
|
@ -596,16 +596,18 @@ const PostStatusForm = {
|
||||||
? this.postHandler
|
? this.postHandler
|
||||||
: statusPoster.postStatus
|
: statusPoster.postStatus
|
||||||
|
|
||||||
postHandler(postingOptions).then((data) => {
|
postHandler(postingOptions)
|
||||||
if (!data.error) {
|
.then((data) => {
|
||||||
this.abandonDraft()
|
this.abandonDraft()
|
||||||
this.clearStatus()
|
this.clearStatus()
|
||||||
this.$emit('posted', data)
|
this.$emit('posted', data)
|
||||||
} else {
|
})
|
||||||
this.error = data.error
|
.catch((error) => {
|
||||||
}
|
this.error = error
|
||||||
this.posting = false
|
})
|
||||||
})
|
.finally(() => {
|
||||||
|
this.posting = false
|
||||||
|
})
|
||||||
},
|
},
|
||||||
previewStatus() {
|
previewStatus() {
|
||||||
if (this.emptyStatus && this.newStatus.spoilerText.trim() === '') {
|
if (this.emptyStatus && this.newStatus.spoilerText.trim() === '') {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue