fix: exception while logging out

This commit is contained in:
or-else
2018-07-29 19:14:41 +03:00
parent 2f8e5c4b33
commit ae73764173
+37 -33
View File
@@ -4383,39 +4383,7 @@
constructor(props) {
super(props);
this.state = {
connected: false,
transport: null,
serverAddress: detectServerAddress(),
sidePanelSelected: 'login',
sidePanelTitle: null,
sidePanelAvatar: null,
dialogSelected: null,
contextMenuVisible: false,
login: '',
password: '',
myUserId: null,
errorText: '',
errorLevel: null,
liveConnection: navigator.onLine,
topicSelected: '',
topicSelectedOnline: false,
topicSelectedAcs: null,
loginDisabled: false,
displayMobile: (window.innerWidth <= MEDIA_BREAKPOINT),
showInfoPanel: false,
infoPanelShowMembers: false,
mobilePanel: 'sidepanel',
contextMenuVisible: false,
contextMenuBounds: null,
contextMenuClickAt: null,
contextMenuParams: null,
contextMenuItems: [],
serverVersion: 'no connection',
contactsSearchQuery: '',
foundContacts: [],
credMethod: ''
};
this.state = this.getInitialState();
this.handleResize = this.handleResize.bind(this);
this.handleHashRoute = this.handleHashRoute.bind(this);
@@ -4464,6 +4432,42 @@
this.handleValidateCredentialsRequest = this.handleValidateCredentialsRequest.bind(this);
}
getInitialState() {
return {
connected: false,
transport: null,
serverAddress: detectServerAddress(),
sidePanelSelected: 'login',
sidePanelTitle: null,
sidePanelAvatar: null,
dialogSelected: null,
contextMenuVisible: false,
login: '',
password: '',
myUserId: null,
errorText: '',
errorLevel: null,
liveConnection: navigator.onLine,
topicSelected: '',
topicSelectedOnline: false,
topicSelectedAcs: null,
loginDisabled: false,
displayMobile: (window.innerWidth <= MEDIA_BREAKPOINT),
showInfoPanel: false,
infoPanelShowMembers: false,
mobilePanel: 'sidepanel',
contextMenuVisible: false,
contextMenuBounds: null,
contextMenuClickAt: null,
contextMenuParams: null,
contextMenuItems: [],
serverVersion: 'no connection',
contactsSearchQuery: '',
foundContacts: [],
credMethod: ''
};
}
componentDidMount() {
var instance = this;
window.addEventListener('resize', this.handleResize);