From 758a5d02ef0dca3f9070e52b5ebd5348539ae9bf Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 12 Feb 2019 23:27:24 -0700 Subject: [PATCH] Update Timeline.vue component, fix infinite scroll and improve empty state in home timeline --- resources/assets/js/components/Timeline.vue | 41 ++++++++++++++++----- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/resources/assets/js/components/Timeline.vue b/resources/assets/js/components/Timeline.vue index 91d8c857a..854c4b422 100644 --- a/resources/assets/js/components/Timeline.vue +++ b/resources/assets/js/components/Timeline.vue @@ -2,6 +2,11 @@
+
+
+ Loading... +
+
@@ -123,15 +128,29 @@
-
- -
No more posts to load
-
No posts found
-
+
+
+
+ +
No more posts to load
+
No posts found
+
+
+
-
@@ -214,7 +233,7 @@
-
+
@@ -245,6 +264,10 @@
+
+

+

0 Notifications!

+
@@ -297,7 +320,7 @@ page: 2, feed: [], profile: {}, - scope: window.location.pathname, + scope: window.location.pathname == '/' ? 'home' : 'local', min_id: 0, max_id: 0, notifications: {}, @@ -357,7 +380,7 @@ fetchTimelineApi() { let homeTimeline = '/api/v1/timelines/home?page=1'; let localTimeline = '/api/v1/timelines/public?page=1'; - let apiUrl = this.scope == '/' ? homeTimeline : localTimeline; + let apiUrl = this.scope == 'home' ? homeTimeline : localTimeline; axios.get(apiUrl).then(res => { let data = res.data; this.feed.push(...data);