Merge pull request #201 from dollars0427/new-toot-loading-screen

Show loading when user post new toot
This commit is contained in:
AkiraFukushima 2018-04-09 20:34:17 +09:00 committed by GitHub
commit 845e43dcf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -103,15 +103,25 @@ export default {
media_ids: this.attachedMedias.map((m) => { return m.id })
})
}
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)
.then(() => {
this.close()
loading.close()
this.$message({
message: 'Toot',
type: 'success'
})
})
.catch(() => {
loading.close()
this.$message({
message: 'Could not toot',
type: 'error'