From d183b9ba1c847d6824d565c493ec8df48f930344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Tue, 14 Jul 2015 21:47:14 +0200 Subject: [PATCH] include intercom --- index.html | 9 +++++++++ js/components/header.js | 13 +++++++++++++ 2 files changed, 22 insertions(+) diff --git a/index.html b/index.html index 0893168d..e845e759 100644 --- a/index.html +++ b/index.html @@ -40,6 +40,15 @@
+ + + + + diff --git a/js/components/header.js b/js/components/header.js index 3b9dc7a3..bcf71ff5 100644 --- a/js/components/header.js +++ b/js/components/header.js @@ -58,6 +58,8 @@ let Header = React.createClass({ handleLogout(){ UserActions.logoutCurrentUser(); Alt.flush(); + // kill intercom (with fire) + window.Intercom('shutdown'); this.transitionTo('login'); }, @@ -89,6 +91,17 @@ let Header = React.createClass({ }, onChange(state) { this.setState(state); + + if(this.state.currentUser && this.state.currentUser.email) { + // bootup intercom if the user is logged in + window.Intercom('boot', { + app_id: 'oboxh5w1', + email: this.state.currentUser.email, + widget: { + activator: '#IntercomDefaultWidget' + } + }); + } }, render() {