mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
Don't try to set page_type if not logged in
This commit is contained in:
parent
959c0f0669
commit
6fc910a259
@ -40,12 +40,19 @@ module.exports = {
|
||||
},
|
||||
|
||||
getInitialState: function() {
|
||||
return {
|
||||
var s = {
|
||||
logged_in: !!(MatrixClientPeg.get() && MatrixClientPeg.get().credentials),
|
||||
ready: false,
|
||||
page_type: MatrixClientPeg.get().getRooms().length ? this.PageTypes.RoomView : this.PageTypes.RoomDirectory,
|
||||
aux_panel: null,
|
||||
};
|
||||
if (s.logged_in) {
|
||||
if (MatrixClientPeg.get().getRooms().length) {
|
||||
s.page_type = this.PageTypes.RoomView;
|
||||
} else {
|
||||
s.page_type = this.PageTypes.RoomDirectory;
|
||||
}
|
||||
}
|
||||
return s;
|
||||
},
|
||||
|
||||
componentDidMount: function() {
|
||||
|
Loading…
Reference in New Issue
Block a user