Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(intercom): safely check for app_id in optional param #106

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/app/ng-intercom/intercom/intercom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class Intercom {
if (!isPlatformBrowser(this.platformId)) {
return
}
const app_id = intercomData.app_id ? intercomData.app_id : this.config.appId
const app_id = intercomData?.app_id ? intercomData.app_id : this.config.appId
// Run load and attach to window
this.loadIntercom(this.config, (event?: Event) => {
// then boot the intercom js
Expand Down Expand Up @@ -187,11 +187,11 @@ export class Intercom {
}

/**
* If you would like to trigger a tour based on an action a user or visitor takes in your site or application,
* ou can use this API method. You need to call this method with the id of the tour you wish to show. The id of
* If you would like to trigger a tour based on an action a user or visitor takes in your site or application,
* ou can use this API method. You need to call this method with the id of the tour you wish to show. The id of
* the tour can be found in the “Use tour everywhere” section of the tour editor.
*
* Please note that tours shown via this API must be published and the “Use tour everywhere” section must be
* Please note that tours shown via this API must be published and the “Use tour everywhere” section must be
* turned on. If you're calling this API using an invalid tour id, nothing will happen.
*/
public startTour(tourId: number): void {
Expand Down