summaryrefslogtreecommitdiffstats
path: root/web/react/utils/utils.jsx
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2015-06-16 13:18:41 -0800
committerCorey Hulen <corey@hulen.com>2015-06-16 13:18:41 -0800
commitf937fa0d9cc5fb8e63c95b53ceea8665c35a8125 (patch)
tree5c8836e535e01d9ce5076104f0db6a4a0c82e313 /web/react/utils/utils.jsx
parentdae0340d7de308d2e6bc7145fb158635b5cdf0ca (diff)
parentd927e2ba69dd355c01878afc0ec57cca6889b8e1 (diff)
downloadchat-f937fa0d9cc5fb8e63c95b53ceea8665c35a8125.tar.gz
chat-f937fa0d9cc5fb8e63c95b53ceea8665c35a8125.tar.bz2
chat-f937fa0d9cc5fb8e63c95b53ceea8665c35a8125.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.jsx12
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(".");
+}