Skip to content

Commit e027da2

Browse files
committed
SERVER-2283: Set api.domain in settings automatically.
Added undefined control for countlyGlobal.domain and fixed eslint rules.
1 parent b4f2201 commit e027da2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/plugins/frontend/public/javascripts/countly.views.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1733,11 +1733,11 @@ $(document).ready(function() {
17331733
app.addMenu("management", {code: "configurations", url: "#/manage/configurations", text: "plugins.configs", icon: '<div class="logo-icon ion-android-options"></div>', priority: 40});
17341734

17351735
var isCurrentHostnameIP = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(window.location.hostname);
1736-
if (!isCurrentHostnameIP && countlyGlobal.domain === "") {
1736+
var isGlobalDomainHasValue = countlyGlobal.domain === "" || typeof countlyGlobal.domain === "undefined" ? false : true;
1737+
if (!isCurrentHostnameIP && !isGlobalDomainHasValue) {
17371738
countlyPlugins.updateConfigs({"api": {"domain": window.location.hostname}}, function(err) {
17381739
if (err) {
17391740
// throw err
1740-
console.log('An error has occurred: ', err);
17411741
}
17421742
});
17431743
}

0 commit comments

Comments
 (0)