about summary refs log tree commit diff
path: root/app/assets/javascripts/components/actions/timelines.jsx
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-01-24 13:04:12 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-01-24 13:04:12 +0100
commit21c209636d12ea601379e7abd3d370ad0d22ea18 (patch)
treeb86a3912ab76e58e02a39edf038cf905f26f0f9c /app/assets/javascripts/components/actions/timelines.jsx
parent1f5792c83475aed785cdd8eb148aa4fdc53b5671 (diff)
Set isLoading false on timelines when request fails
Diffstat (limited to 'app/assets/javascripts/components/actions/timelines.jsx')
-rw-r--r--app/assets/javascripts/components/actions/timelines.jsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/assets/javascripts/components/actions/timelines.jsx b/app/assets/javascripts/components/actions/timelines.jsx
index 1d7e0547c..29a060e87 100644
--- a/app/assets/javascripts/components/actions/timelines.jsx
+++ b/app/assets/javascripts/components/actions/timelines.jsx
@@ -63,6 +63,10 @@ export function refreshTimelineRequest(timeline, id, skipLoading) {
 
 export function refreshTimeline(timeline, id = null) {
   return function (dispatch, getState) {
+    if (getState().getIn(['timelines', timeline, 'isLoading'])) {
+      return;
+    }
+
     const ids      = getState().getIn(['timelines', timeline, 'items'], Immutable.List());
     const newestId = ids.size > 0 ? ids.first() : null;
 
@@ -102,8 +106,9 @@ export function expandTimeline(timeline, id = null) {
   return (dispatch, getState) => {
     const lastId = getState().getIn(['timelines', timeline, 'items'], Immutable.List()).last();
 
-    if (!lastId) {
+    if (!lastId || getState().getIn(['timelines', timeline, 'isLoading'])) {
       // If timeline is empty, don't try to load older posts since there are none
+      // Also if already loading
       return;
     }