From 0ea0233c50dbccc498cb53481b9fdf18d027e5b2 Mon Sep 17 00:00:00 2001
From: Christopher Speller <crspeller@gmail.com>
Date: Mon, 14 Sep 2015 13:56:58 -0400
Subject: New add channel modal using react-bootstrap.

---
 web/react/utils/utils.jsx | 11 +++++++++++
 1 file changed, 11 insertions(+)

(limited to 'web/react/utils/utils.jsx')

diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index 71cd1d344..2fd6152c3 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -1127,3 +1127,14 @@ export function importSlack(file, success, error) {
 
     client.importSlack(formData, success, error);
 }
+
+export function getTeamURLFromAddressBar() {
+    return window.location.href.split('/channels')[0];
+}
+
+export function getShortenedTeamURL() {
+    const teamURL = getTeamURLFromAddressBar();
+    if (teamURL.length > 24) {
+        return teamURL.substring(0, 10) + '...' + teamURL.substring(teamURL.length - 12, teamURL.length - 1) + '/';
+    }
+}
-- 
cgit v1.2.3-1-g7c22

