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, 6 insertions, 5 deletions
diff --git a/app/assets/javascripts/components/actions/timelines.jsx b/app/assets/javascripts/components/actions/timelines.jsx
index 5258d7103..831065feb 100644
--- a/app/assets/javascripts/components/actions/timelines.jsx
+++ b/app/assets/javascripts/components/actions/timelines.jsx
@@ -11,11 +11,12 @@ export const TIMELINE_EXPAND_REQUEST = 'TIMELINE_EXPAND_REQUEST';
 export const TIMELINE_EXPAND_SUCCESS = 'TIMELINE_EXPAND_SUCCESS';
 export const TIMELINE_EXPAND_FAIL    = 'TIMELINE_EXPAND_FAIL';
 
-export function refreshTimelineSuccess(timeline, statuses) {
+export function refreshTimelineSuccess(timeline, statuses, replace) {
   return {
     type: TIMELINE_REFRESH_SUCCESS,
     timeline: timeline,
-    statuses: statuses
+    statuses: statuses,
+    replace: replace
   };
 };
 
@@ -41,7 +42,7 @@ export function refreshTimelineRequest(timeline) {
   };
 };
 
-export function refreshTimeline(timeline) {
+export function refreshTimeline(timeline, replace = false) {
   return function (dispatch, getState) {
     dispatch(refreshTimelineRequest(timeline));
 
@@ -50,12 +51,12 @@ export function refreshTimeline(timeline) {
 
     let params = '';
 
-    if (newestId !== null) {
+    if (newestId !== null && !replace) {
       params = `?since_id=${newestId}`;
     }
 
     api(getState).get(`/api/v1/statuses/${timeline}${params}`).then(function (response) {
-      dispatch(refreshTimelineSuccess(timeline, response.data));
+      dispatch(refreshTimelineSuccess(timeline, response.data, replace));
     }).catch(function (error) {
       dispatch(refreshTimelineFail(timeline, error));
     });