From 9528450d2b0e8c8ff8cdd96cf4fcc47bce9a2b1a Mon Sep 17 00:00:00 2001 From: Sardo Date: Mon, 9 Apr 2018 15:49:41 +0800 Subject: [PATCH] Show loading when user post new toot --- .../components/TimelineSpace/Modals/NewToot.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/renderer/components/TimelineSpace/Modals/NewToot.vue b/src/renderer/components/TimelineSpace/Modals/NewToot.vue index 7f296a1dba..4751dc99c0 100644 --- a/src/renderer/components/TimelineSpace/Modals/NewToot.vue +++ b/src/renderer/components/TimelineSpace/Modals/NewToot.vue @@ -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'