Merge pull request #201 from dollars0427/new-toot-loading-screen
Show loading when user post new toot
This commit is contained in:
commit
845e43dcf6
|
@ -103,15 +103,25 @@ export default {
|
||||||
media_ids: this.attachedMedias.map((m) => { return m.id })
|
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)
|
this.$store.dispatch('TimelineSpace/Modals/NewToot/postToot', form)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.close()
|
this.close()
|
||||||
|
loading.close()
|
||||||
this.$message({
|
this.$message({
|
||||||
message: 'Toot',
|
message: 'Toot',
|
||||||
type: 'success'
|
type: 'success'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
loading.close()
|
||||||
this.$message({
|
this.$message({
|
||||||
message: 'Could not toot',
|
message: 'Could not toot',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
|
|
Loading…
Reference in New Issue