2015-07-27 18:06:02 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
import alt from '../alt';
|
|
|
|
import EventActions from '../actions/event_actions';
|
|
|
|
|
2015-09-29 14:58:56 +02:00
|
|
|
import { getSubdomain } from '../utils/general_utils';
|
|
|
|
|
2015-07-27 18:06:02 +02:00
|
|
|
|
|
|
|
class IntercomHandler {
|
|
|
|
constructor() {
|
|
|
|
this.bindActions(EventActions);
|
|
|
|
this.loaded = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
onProfileDidLoad(profile) {
|
|
|
|
if (this.loaded) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* eslint-disable */
|
2015-07-27 18:21:20 +02:00
|
|
|
Intercom('boot', {
|
2015-07-27 18:06:02 +02:00
|
|
|
/* eslint-enable */
|
|
|
|
app_id: 'oboxh5w1',
|
|
|
|
email: profile.email,
|
2015-09-29 14:58:56 +02:00
|
|
|
subdomain: getSubdomain(),
|
2015-07-27 18:06:02 +02:00
|
|
|
widget: {
|
|
|
|
activator: '#IntercomDefaultWidget'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
console.log('Intercom loaded');
|
|
|
|
this.loaded = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export default alt.createStore(IntercomHandler, 'IntercomHandler');
|