Skip to content

[FIX] Added navigation from Register to Room List#1568

Closed
m1-key wants to merge 3 commits intoRocketChat:developfrom
m1-key:navigationToRoomList
Closed

[FIX] Added navigation from Register to Room List#1568
m1-key wants to merge 3 commits intoRocketChat:developfrom
m1-key:navigationToRoomList

Conversation

@m1-key
Copy link

@m1-key m1-key commented Jan 12, 2020

@RocketChat/ReactNative

Closes #1544

I added just 2 line code into the RegisterView.js and SetUsername.js , first line extracted the navigation from the props and then in the second line I navigated from above two mentioned screens to the RoomsListView. So earlier when we click on Register button , nothing happens which can be seen on screen. Now on pressing the Register Button , we will be directed to the RoomsListView.

Here is view of that :

vSUosn

Copy link
Contributor

@djorkaeffalexandre djorkaeffalexandre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only need few changes. Thanks a lot! 😁

Alert.alert(I18n.t('Oops'), e.data.error);
}
this.setState({ saving: false });
const { navigation } = this.props;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On both cases you can't redirect to RoomsList if some error occurred on catch. 😁
I think it's better you can put it after await loginRequest({ user: email, password });.

Copy link
Author

@m1-key m1-key Jan 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So basically I have to put move changes in try block, is it @djorkaeffalexandre ?

log(e);
}
this.setState({ saving: false });
const { navigation } = this.props;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same of comment above.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made the changes, now you can verify that sir .

@djorkaeffalexandre
Copy link
Contributor

Hello @m1-key , how you can see here: https://github.com/RocketChat/Rocket.Chat.ReactNative/blob/develop/app/sagas/login.js#L118, we make this navigation on appStart after login success.
With your PR, we had navigate two times to RoomsList.
Can you provide an example about when the navigation doesn't work?
Thanks.

@m1-key
Copy link
Author

m1-key commented Jan 13, 2020

@djorkaeffalexandre I have change the navigation of Create an Account from there to login portal and for registration via Google, GitHub, it takes us to RoomList as there is no need of any verification. Something similar I have done in #1567 . So when user create an account using Create an Account method then user will be re-directed to login portal where he/she can login after verifying the email. And when the user create the account via Google or GitHub , then he/she will be redirected to Room list .

J7_yxt

@m1-key
Copy link
Author

m1-key commented Jan 16, 2020

@djorkaeffalexandre any changes required in this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No confirmation message is displayed on successful registration

3 participants