@@ -144,7 +144,7 @@ const AUTH_SCREENS = ["register", "mobile_register", "login", "forgot_password",
144144// Actions that are redirected through the onboarding process prior to being
145145// re-dispatched. NOTE: some actions are non-trivial and would require
146146// re-factoring to be included in this list in future.
147- const ONBOARDING_FLOW_STARTERS = [ Action . ViewUserSettings , "view_create_chat" , "view_create_room" ] ;
147+ const ONBOARDING_FLOW_STARTERS = [ Action . ViewUserSettings , Action . CreateChat , Action . CreateRoom ] ;
148148
149149interface IScreen {
150150 screen : string ;
@@ -616,7 +616,10 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
616616 }
617617
618618 // Start the onboarding process for certain actions
619- if ( MatrixClientPeg . get ( ) ?. isGuest ( ) && ONBOARDING_FLOW_STARTERS . includes ( payload . action ) ) {
619+ if (
620+ MatrixClientPeg . get ( ) ?. isGuest ( ) &&
621+ ONBOARDING_FLOW_STARTERS . includes ( payload . action as unknown as Action )
622+ ) {
620623 // This will cause `payload` to be dispatched later, once a
621624 // sync has reached the "prepared" state. Setting a matrix ID
622625 // will cause a full login and sync and finally the deferred
@@ -785,7 +788,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
785788 this . viewSomethingBehindModal ( ) ;
786789 break ;
787790 }
788- case "view_create_room" :
791+ case Action . CreateRoom :
789792 this . createRoom ( payload . public , payload . defaultName , payload . type ) ;
790793
791794 // View the welcome or home page if we need something to look at
@@ -816,7 +819,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
816819 case Action . ViewStartChatOrReuse :
817820 this . chatCreateOrReuse ( payload . user_id ) ;
818821 break ;
819- case "view_create_chat" :
822+ case Action . CreateChat :
820823 showStartChatInviteDialog ( payload . initialText || "" ) ;
821824
822825 // View the welcome or home page if we need something to look at
@@ -1758,11 +1761,11 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
17581761 }
17591762 } else if ( screen === "new" ) {
17601763 dis . dispatch ( {
1761- action : "view_create_room" ,
1764+ action : Action . CreateRoom ,
17621765 } ) ;
17631766 } else if ( screen === "dm" ) {
17641767 dis . dispatch ( {
1765- action : "view_create_chat" ,
1768+ action : Action . CreateChat ,
17661769 } ) ;
17671770 } else if ( screen === "settings" ) {
17681771 dis . fire ( Action . ViewUserSettings ) ;
0 commit comments