CaliStyle / ng-intercom

Angular 7+ Wrapper for Intercom.com
MIT License
54 stars 46 forks source link

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

Open yharaskrik opened 2 years ago

yharaskrik commented 2 years ago

Summary of changes: Because intercomData is optional in the boot method then we need to use optional chaining to check for app_id otherwise it will error if that parameter is not passed on

Intended/example use case: app_id is configured in the forRoot method so when calling .boot() without a paramter the line const app_id = intercomData.app_id ? intercomData.app_id : this.config.appId will error since intercomData is optional.

Checklist:

Closes issue: #