From aff22bfdb554207ae73b8946310f7328f645be70 Mon Sep 17 00:00:00 2001
From: Eugen Rochko <eugen@zeonfederated.com>
Date: Thu, 3 Nov 2016 11:06:55 +0100
Subject: Add own composed status to home without waiting for websocket event
 This makes the UI appear less laggy. After all, the status *is* created right
 there and then, it's the distribution to home timelines that can take a while

---
 app/assets/javascripts/components/reducers/timelines.jsx | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'app/assets/javascripts/components/reducers/timelines.jsx')

diff --git a/app/assets/javascripts/components/reducers/timelines.jsx b/app/assets/javascripts/components/reducers/timelines.jsx
index db13cad31..c12d1b70d 100644
--- a/app/assets/javascripts/components/reducers/timelines.jsx
+++ b/app/assets/javascripts/components/reducers/timelines.jsx
@@ -95,6 +95,10 @@ const updateTimeline = (state, timeline, status, references) => {
   state = normalizeStatus(state, status);
 
   state = state.update(timeline, list => {
+    if (list.includes(status.get('id'))) {
+      return list;
+    }
+
     const reblogOfId = status.getIn(['reblog', 'id'], null);
 
     if (reblogOfId !== null) {
-- 
cgit 

