@@ -466,7 +466,7 @@ module.exports = React.createClass({
466
466
this . notifyNewScreen ( 'home' ) ;
467
467
break ;
468
468
case 'view_set_mxid' :
469
- this . _setMxId ( ) ;
469
+ this . _setMxId ( payload ) ;
470
470
break ;
471
471
case 'view_start_chat_or_reuse' :
472
472
this . _chatCreateOrReuse ( payload . user_id ) ;
@@ -680,7 +680,7 @@ module.exports = React.createClass({
680
680
} ) ;
681
681
} ,
682
682
683
- _setMxId : function ( ) {
683
+ _setMxId : function ( payload ) {
684
684
const SetMxIdDialog = sdk . getComponent ( 'views.dialogs.SetMxIdDialog' ) ;
685
685
const close = Modal . createDialog ( SetMxIdDialog , {
686
686
homeserverUrl : MatrixClientPeg . get ( ) . getHomeserverUrl ( ) ,
@@ -689,6 +689,11 @@ module.exports = React.createClass({
689
689
dis . dispatch ( {
690
690
action : 'cancel_after_sync_prepared' ,
691
691
} ) ;
692
+ if ( payload . go_home_on_cancel ) {
693
+ dis . dispatch ( {
694
+ action : 'view_home_page' ,
695
+ } ) ;
696
+ }
692
697
return ;
693
698
}
694
699
this . onRegistered ( credentials ) ;
@@ -769,6 +774,11 @@ module.exports = React.createClass({
769
774
}
770
775
dis . dispatch ( {
771
776
action : 'view_set_mxid' ,
777
+ // If the set_mxid dialog is cancelled, view /home because if the browser
778
+ // was pointing at /user/@someone :domain?action=chat, the URL needs to be
779
+ // reset so that they can revisit /user/.. // (and trigger
780
+ // `_chatCreateOrReuse` again)
781
+ go_home_on_cancel : true ,
772
782
} ) ;
773
783
return ;
774
784
}
0 commit comments