Initialize and close WebSocket more accurately and consistently (#3683)

Этот коммит содержится в:
Joram Wilander
2016-07-27 09:54:43 -04:00
коммит произвёл Christopher Speller
родитель 199c55b566
Коммит fc7ae6ba65
2 изменённых файлов: 6 добавлений и 11 удалений

Просмотреть файл

@@ -25,9 +25,6 @@ export default class LoggedIn extends React.Component {
this.onUserChanged = this.onUserChanged.bind(this);
this.setupUser = this.setupUser.bind(this);
// Initalize websocket
WebSocketActions.initialize();
// Force logout of all tabs if one tab is logged out
$(window).bind('storage', (e) => {
// when one tab on a browser logs out, it sets __logout__ in localStorage to trigger other tabs to log out
@@ -105,6 +102,9 @@ export default class LoggedIn extends React.Component {
}
componentDidMount() {
// Initalize websocket
WebSocketActions.initialize();
// Listen for user
UserStore.addChangeListener(this.onUserChanged);