summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyrille Bollu <cyrpub@bollu.be>2019-10-14 15:16:00 +0200
committerRobin Appelman <robin@icewind.nl>2020-10-13 23:53:01 +0200
commit13fdd63efb6f6e737a5a18efbf435625db632fdd (patch)
treef987c66a11b22024bca15fffa6d37f6a6413f7f1
parent8f6aa483b427cb27a27eaefd70f01f543e8978de (diff)
FIX: In single post timeline, do not load TimelineList component when
there are no answers. Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>
-rw-r--r--src/views/TimelineSinglePost.vue18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/views/TimelineSinglePost.vue b/src/views/TimelineSinglePost.vue
index b02d3113..e14f77d5 100644
--- a/src/views/TimelineSinglePost.vue
+++ b/src/views/TimelineSinglePost.vue
@@ -2,7 +2,7 @@
<div class="social__wrapper">
<profile-info v-if="accountLoaded && accountInfo" :uid="uid" />
<timeline-entry :item="mainPost" />
- <timeline-list :type="$route.params.type" />
+ <timeline-list v-if="timeline" :type="$route.params.type" />
</div>
</template>
@@ -45,9 +45,23 @@ export default {
}
},
computed: {
- // Extract the viewed account name from the URL
+ /**
+ * Extract the viewed account name from the URL
+ *
+ * @returns {String}
+ *
+ */
account() {
return window.location.href.split('/')[window.location.href.split('/').length - 2].substr(1)
+ },
+ /**
+ * Returns the timeline currently loaded in the store
+ *
+ * @returns {Object}
+ *
+ */
+ timeline: function() {
+ return this.$store.getters.getTimeline
}
},
beforeMount: function() {