diff options
author | Corey Hulen <corey@hulen.com> | 2015-06-16 13:18:41 -0800 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-06-16 13:18:41 -0800 |
commit | 6315af920a8ba696834d163dab3d3be85b680973 (patch) | |
tree | b489298edb5b8dc5bf1782d8044aea35f84a7ce0 /web/react/utils/utils.jsx | |
parent | fdb3f152748a3590516e53fd3864eb91d3b62bbb (diff) | |
parent | 8d3b36ed3d68613b2155d6e7d448a1ed69611e62 (diff) | |
download | chat-6315af920a8ba696834d163dab3d3be85b680973.tar.gz chat-6315af920a8ba696834d163dab3d3be85b680973.tar.bz2 chat-6315af920a8ba696834d163dab3d3be85b680973.zip |
Merge pull request #14 from mattermost/mm-1294
MM-1294 - Parsing homelink from URL instead of using config setting.
Diffstat (limited to 'web/react/utils/utils.jsx')
-rw-r--r-- | web/react/utils/utils.jsx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 72ed48faf..628d92342 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -730,3 +730,15 @@ Image.prototype.load = function(url, progressCallback) { }; Image.prototype.completedPercentage = 0; + +module.exports.getHomeLink = function() { + if (config.HomeLink != "") { + return config.HomeLink; + } + var parts = window.location.host.split("."); + if (parts.length <= 1) { + return window.location.protocol + "//" + window.location.host; + } + parts[0] = "www"; + return window.location.protocol + "//" + parts.join("."); +} |