Browse Source
Merge pull request #6722 from Budibase/fix/intercom-self-host-only
only show intercom in cloud
master
Martin McKeaveney
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
8 additions and
6 deletions
-
packages/builder/src/analytics/IntercomClient.js
-
packages/builder/src/stores/portal/auth.js
|
|
|
@ -53,12 +53,12 @@ export default class IntercomClient { |
|
|
|
* @returns Intercom global object |
|
|
|
*/ |
|
|
|
show(user = {}) { |
|
|
|
if (!this.initialised || !user?.admin) return |
|
|
|
|
|
|
|
return window.Intercom("boot", { |
|
|
|
app_id: this.token, |
|
|
|
...user, |
|
|
|
}) |
|
|
|
if (this.initialised && user?.admin && user?.cloud) { |
|
|
|
return window.Intercom("boot", { |
|
|
|
app_id: this.token, |
|
|
|
...user, |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
@ -54,6 +54,7 @@ export function createAuthStore() { |
|
|
|
}) |
|
|
|
|
|
|
|
if (user) { |
|
|
|
const adminStore = get(admin) |
|
|
|
analytics |
|
|
|
.activate() |
|
|
|
.then(() => { |
|
|
|
@ -68,6 +69,7 @@ export function createAuthStore() { |
|
|
|
builder: user?.builder?.global, |
|
|
|
"Company size": user.account?.size, |
|
|
|
"Job role": user.account?.profession, |
|
|
|
cloud: adminStore.cloud, |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
|