summaryrefslogtreecommitdiffstats
path: root/web/react/utils/utils.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-09-14 13:56:58 -0400
committerChristopher Speller <crspeller@gmail.com>2015-09-14 13:56:58 -0400
commit0ea0233c50dbccc498cb53481b9fdf18d027e5b2 (patch)
treedd8c22f83aea91fe463d122fd564176def2dfb39 /web/react/utils/utils.jsx
parentb2378f433ecd44a9811a52bd58e36a40f92e193f (diff)
downloadchat-0ea0233c50dbccc498cb53481b9fdf18d027e5b2.tar.gz
chat-0ea0233c50dbccc498cb53481b9fdf18d027e5b2.tar.bz2
chat-0ea0233c50dbccc498cb53481b9fdf18d027e5b2.zip
New add channel modal using react-bootstrap.
Diffstat (limited to 'web/react/utils/utils.jsx')
-rw-r--r--web/react/utils/utils.jsx11
1 files changed, 11 insertions, 0 deletions
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) + '/';
+ }
+}