From d576bc3972d52d32e54a18e6d46b144211c68a11 Mon Sep 17 00:00:00 2001
From: chylex <info@chylex.com>
Date: Sat, 3 Sep 2016 16:15:28 +0200
Subject: [PATCH] Work around Scheduled column update delay bug in TweetDeck

Closes #53
---
 Resources/Scripts/code.js | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/Resources/Scripts/code.js b/Resources/Scripts/code.js
index 45f4dd1b..bb8bee91 100644
--- a/Resources/Scripts/code.js
+++ b/Resources/Scripts/code.js
@@ -397,6 +397,21 @@
     }
   };
   
+  //
+  // Block: Fix scheduled tweets not showing up sometimes.
+  //
+  $(document).on("dataTweetSent", function(e, data){
+    if (data.response.state && data.response.state === "scheduled"){
+      var column = Object.values(TD.controller.columnManager.getAll()).find(column => column.model.state.type === "scheduled");
+
+      if (column){
+        setTimeout(function(){
+          column.reloadTweets();
+        }, 1000);
+      }
+    }
+  });
+  
   //
   // Block: Inject custom CSS and layout into the page.
   //