Skip to content
Snippets Groups Projects
Commit 6fc910a2 authored by David Baker's avatar David Baker
Browse files

Don't try to set page_type if not logged in

parent 959c0f06
Branches
Tags
No related merge requests found
...@@ -40,12 +40,19 @@ module.exports = { ...@@ -40,12 +40,19 @@ module.exports = {
}, },
getInitialState: function() { getInitialState: function() {
return { var s = {
logged_in: !!(MatrixClientPeg.get() && MatrixClientPeg.get().credentials), logged_in: !!(MatrixClientPeg.get() && MatrixClientPeg.get().credentials),
ready: false, ready: false,
page_type: MatrixClientPeg.get().getRooms().length ? this.PageTypes.RoomView : this.PageTypes.RoomDirectory,
aux_panel: null, 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() { componentDidMount: function() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment