Skip to content

v0.0.7

Compare
Choose a tag to compare
@mathieustan mathieustan released this 19 Nov 11:13

What's new in v0.0.7

💥 Breaking Change

  • Migration from v0.0.6 to v0.0.7:

Only if you were using import { Intercom } from '@mathieustan/vue-intercom'
It will no longer wait script to be loaded before init

import { Intercom } from '@mathieustan/vue-intercom';
const appId = 'faleAppId';

// -- Before 
async function initIntercomService() {
  const service = new Intercom({ appId });
  await service.load();
  service.init();

  return service;
}

async function startIntercomMessenger(user) {
 try {
   const intercom = await initIntercomService();
   intercom.boot(user);
 } catch (err) => ...
}


// -- After
function startIntercomMessenger(user) {
 try {
   const intercom = new Intercom({ appId });
   intercom.once('ready', () => intercom.boot(user));
 } catch (err) => ...
}

🐛 Fixes

If you are using 'vue-intercom' as vue plugin.
Intercom script may not yet be ready when trying to boot intercom with a user.

To solve this problem, just do:

created() {
  this.$intercom.once('ready', () => this.$intercom.boot(this.user));
}