diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-09-14 13:56:58 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-09-14 13:56:58 -0400 |
commit | 0ea0233c50dbccc498cb53481b9fdf18d027e5b2 (patch) | |
tree | dd8c22f83aea91fe463d122fd564176def2dfb39 /web/react/utils | |
parent | b2378f433ecd44a9811a52bd58e36a40f92e193f (diff) | |
download | chat-0ea0233c50dbccc498cb53481b9fdf18d027e5b2.tar.gz chat-0ea0233c50dbccc498cb53481b9fdf18d027e5b2.tar.bz2 chat-0ea0233c50dbccc498cb53481b9fdf18d027e5b2.zip |
New add channel modal using react-bootstrap.
Diffstat (limited to 'web/react/utils')
-rw-r--r-- | web/react/utils/utils.jsx | 11 |
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) + '/'; + } +} |