From 03998f0a70cb8ad1edc2d8b86a8bec85d3b0fa4e Mon Sep 17 00:00:00 2001 From: jaybell Date: Tue, 4 Jan 2022 12:02:39 -0800 Subject: [PATCH] fix(intercom): safely check for app_id in optional param --- src/app/ng-intercom/intercom/intercom.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/ng-intercom/intercom/intercom.ts b/src/app/ng-intercom/intercom/intercom.ts index 9113a1c..428bf58 100644 --- a/src/app/ng-intercom/intercom/intercom.ts +++ b/src/app/ng-intercom/intercom/intercom.ts @@ -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 @@ -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 {