about summary refs log tree commit diff
path: root/app/assets/javascripts/components/actions/timelines.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/components/actions/timelines.jsx')
-rw-r--r--app/assets/javascripts/components/actions/timelines.jsx11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/assets/javascripts/components/actions/timelines.jsx b/app/assets/javascripts/components/actions/timelines.jsx
index f92f758f5..5258d7103 100644
--- a/app/assets/javascripts/components/actions/timelines.jsx
+++ b/app/assets/javascripts/components/actions/timelines.jsx
@@ -45,7 +45,16 @@ export function refreshTimeline(timeline) {
   return function (dispatch, getState) {
     dispatch(refreshTimelineRequest(timeline));
 
-    api(getState).get(`/api/v1/statuses/${timeline}`).then(function (response) {
+    const ids      = getState().getIn(['timelines', timeline]);
+    const newestId = ids.size > 0 ? ids.first() : null;
+
+    let params = '';
+
+    if (newestId !== null) {
+      params = `?since_id=${newestId}`;
+    }
+
+    api(getState).get(`/api/v1/statuses/${timeline}${params}`).then(function (response) {
       dispatch(refreshTimelineSuccess(timeline, response.data));
     }).catch(function (error) {
       dispatch(refreshTimelineFail(timeline, error));