fix: Close new toot modal when post

This commit is contained in:
AkiraFukushima 2018-08-01 21:32:21 +09:00
parent 94071ab3aa
commit a5eeac7230
1 changed files with 1 additions and 16 deletions

View File

@ -169,29 +169,14 @@ export default {
}) })
} }
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
this.$store.dispatch('TimelineSpace/Modals/NewToot/postToot', form) this.$store.dispatch('TimelineSpace/Modals/NewToot/postToot', form)
.then(() => {
this.close()
loading.close()
this.$message({
message: 'Toot',
type: 'success'
})
})
.catch(() => { .catch(() => {
loading.close()
this.$message({ this.$message({
message: 'Could not toot', message: 'Could not toot',
type: 'error' type: 'error'
}) })
}) })
this.close()
}, },
selectImage () { selectImage () {
this.$refs.image.click() this.$refs.image.click()