Fixes riot-web#4334
When we do a token login, don't carry on with the normal app startup
(transitioning to the loggedIn state etc) - instead tell the app about the
successful login and wait for it to redirect.
Replace onLoadCompleted with onTokenLoginCompleted so that the app can see what
it's supposed to be doing.
and also things like the unsent message error and encryption
warning.
Stuff that we need to do at room view mount time had got moved into
a clause of the if statement in onHaveRoom and so wasn't being
executed.
Fixes https://github.com/vector-im/riot-web/issues/4327
MatrixChat is essentially a glorified state machine, with its states partially
determined by the loading, loggedIn and loggingIn state flags. If we actually
make each of the states implied by those flags an explicit 'view', then
everything gets much clearer.
'screen' is overloaded, as it us used for the parameter of `showScreen` (and,
by implication, `state.screenAfterLogin`). Attempt to clear up the confusion by
replacing 'screen' with 'view' and using some constants for the potential
values.
This should be a no-op!
If we successfully join, display a spinner until the js-sdk indicates (via room membership event or room event) that we can start using the room normally. A room event indicates we have never seen that room which means we need to use the new room object to clobber state.room. This is to make sure we replace the room that is set up for peeking with the room that can be used normally. For historical rooms, this isn't a problem.
This is a workaround for the fact that when peeking, the js-sdk calls onRoom, which is difficult to handle from the clients perspective because onRoom should only be called for rooms that you've never seen before. But if you peek a room that you've joined and left and get an onRoom, you run into trouble. You also can't just always use onRoomMembership because this won't be triggered for the first time you see the room. So we end up using a combination of both.
See https://github.com/matrix-org/matrix-js-sdk/issues/464 for discussion on improving this
Fixes https://github.com/vector-im/riot-web/issues/4311
The cancel button onClick was hooked directly up to onFinished, so
the mouse event ended up as the boolean for whether an email had
been set.
Fixes https://github.com/vector-im/riot-web/issues/4311
This was due to `BaseDialog` calling `onFinished` with a mouse event instead of `false` (and it was assumed to call with `true/false`, but doesn't)
This fixes an unintuitive behaviour where, if you follow a link to
riot.im/app/#/login, we take you to the login page, but not before we've
registered a guest account (or restarted the MatrixClient with the stored
creds).
This actually ends up simplifying some of the startup dance, as we special-case
the registration flows earlier on.