Skip to content
Snippets Groups Projects
Commit 048cc4c1 authored by Tom Robinson's avatar Tom Robinson
Browse files

Merge branch 'master' of github.com:metabase/metabase-init into metadata_editing

parents 9425db47 a6d397b7
No related branches found
No related tags found
No related merge requests found
......@@ -41,6 +41,16 @@ CorvusServices.factory('AppState', ['$rootScope', '$q', '$location', '$timeout',
}, function(error) {
deferred.resolve();
});
// start Intercom updater
// this tells Intercom to update every 60s if we have a currently logged in user
$timeout(function() {
if (service.model.currentUser) {
/* eslint-disable */
window.Intercom('update');
/* eslint-enable */
}
}, 60000);
}
return initPromise;
......@@ -186,6 +196,21 @@ CorvusServices.factory('AppState', ['$rootScope', '$q', '$location', '$timeout',
Session.delete({
'session_id': session_id
});
// close down intercom
/* eslint-disable */
window.Intercom('shutdown');
/* eslint-enable */
});
$rootScope.$on("appstate:user", function(event, user) {
/* eslint-disable */
window.Intercom('boot', {
app_id: "gqfmsgf1",
name: user.common_name,
email: user.email
});
/* eslint-enable */
});
// NOTE: the below events are generated from the http-auth-interceptor which listens on our $http calls
......
......@@ -8,6 +8,8 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<title>Metabase</title>
<script>(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/gqfmsgf1';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()</script>
</head>
<body ng-controller="Corvus">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment