Don't do a deferred start chat if user is welcome user

There's no point in deferring creating a new DM with the welcome user because the setMxId dialog will do so anyway.
This commit is contained in:
Luke Barnard 2017-06-05 13:14:55 +01:00
parent d72db5df87
commit beafb68538

View file

@ -721,6 +721,9 @@ module.exports = React.createClass({
);
// Use a deferred action to reshow the dialog once the user has registered
if (MatrixClientPeg.get().isGuest()) {
// No point in making 2 DMs with welcome bot. This assumes view_set_mxid will
// result in a new DM with the welcome user.
if (userId !== this.props.config.welcomeUserId) {
dis.dispatch({
action: 'do_after_sync_prepared',
deferred_action: {
@ -728,6 +731,7 @@ module.exports = React.createClass({
user_id: userId,
},
});
}
dis.dispatch({
action: 'view_set_mxid',
});