From 29d37d6489726e6b55dfd00bb9df5325be15b0d6 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Tue, 13 Mar 2018 23:31:06 +0900 Subject: [PATCH] refs #7 Add loading when load home timeline --- src/renderer/components/TimelineSpace.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/renderer/components/TimelineSpace.vue b/src/renderer/components/TimelineSpace.vue index 05c6e69b..ab97e7ed 100644 --- a/src/renderer/components/TimelineSpace.vue +++ b/src/renderer/components/TimelineSpace.vue @@ -16,10 +16,20 @@ export default { name: 'timeline-space', components: { SideMenu, NewTootModal }, created () { + const loading = this.$loading({ + lock: true, + text: 'Loading', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }) this.$store.dispatch('TimelineSpace/fetchAccount', this.$route.params.id) .then((account) => { this.$store.dispatch('TimelineSpace/fetchHomeTimeline', account) + .then(() => { + loading.close() + }) .catch(() => { + loading.close() this.$message({ message: 'Could not fetch timeline', type: 'error' @@ -49,6 +59,7 @@ export default { this.$store.dispatch('TimelineSpace/watchShortcutEvents', account) }) .catch(() => { + loading.close() this.$message({ message: 'Could not find account', type: 'error'