From e3dbf057fbf866c82c1fbdcc4db91ba07a450c73 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 17 May 2017 18:49:59 +0100 Subject: [PATCH] Fix 'missing page_type' error LoggedInView will complain if it is instantiated without a page_type, so let's keep showing the syncing spinner until we have one. --- src/components/structures/MatrixChat.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 54b8c8d1d8..0de38ab226 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -1171,7 +1171,12 @@ module.exports = React.createClass({ ); - } else if (this.state.loggedIn && this.state.ready) { + } + + // `ready` and `loggedIn` may be set before `page_type` (because the + // latter is set via the dispatcher). If we don't yet have a `page_type`, + // keep showing the spinner for now. + if (this.state.loggedIn && this.state.ready && this.state.page_type) { /* for now, we stuff the entirety of our props and state into the LoggedInView. * we should go through and figure out what we actually need to pass down, as well * as using something like redux to avoid having a billion bits of state kicking around.