From aa1e1549d8c601da35447be312f26fbf2073b529 Mon Sep 17 00:00:00 2001
From: chylex <contact@chylex.com>
Date: Thu, 3 May 2018 15:04:09 +0200
Subject: [PATCH] Fix Twitter's broken Cancel button when logging out

---
 Resources/Scripts/twitter.js | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/Resources/Scripts/twitter.js b/Resources/Scripts/twitter.js
index b4a3e9da..7d017603 100644
--- a/Resources/Scripts/twitter.js
+++ b/Resources/Scripts/twitter.js
@@ -60,4 +60,16 @@
       }
     });
   }
+  //
+  // Block: Fix broken Cancel button on logout page.
+  //
+  else if (location.pathname === "/logout"){
+    document.addEventListener("DOMContentLoaded", function(){
+      let cancel = document.querySelector(".buttons .cancel");
+
+      if (cancel && cancel.tagName === "A"){
+        cancel.href = "https://tweetdeck.twitter.com/";
+      }
+    });
+  }
 })();