1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 01:25:17 +01:00
onion/js/components/logout_container.js
2015-07-17 18:53:04 +02:00

37 lines
792 B
JavaScript

'use strict';
import React from 'react';
import Router from 'react-router';
import UserActions from '../actions/user_actions';
import Alt from '../alt';
import AppConstants from '../constants/application_constants';
let baseUrl = AppConstants.baseUrl;
let LogoutContainer = React.createClass({
mixins: [Router.Navigation, Router.State],
componentDidMount() {
UserActions.logoutCurrentUser()
.then(() => {
Alt.flush();
// kill intercom (with fire)
window.Intercom('shutdown');
this.transitionTo(baseUrl);
})
.catch((err) => {
console.logGlobal(err);
});
},
render() {
return null;
}
});
export default LogoutContainer;