[IMPROVEMENT] Enable navigating to a room from auth deep linking (#2115)

* Wait for login success to navigate

* Enable auth and room deep linking at the same time
This commit is contained in:
Diego Mello 2020-05-13 15:57:54 -03:00 committed by GitHub
parent 0009e7fec5
commit ff60cc1fbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -75,7 +75,7 @@ const handleOpen = function* handleOpen({ params }) {
if (!connected) { if (!connected) {
yield localAuthenticate(host); yield localAuthenticate(host);
yield put(selectServerRequest(host)); yield put(selectServerRequest(host));
yield take(types.SERVER.SELECT_SUCCESS); yield take(types.LOGIN.SUCCESS);
} }
yield navigate({ params }); yield navigate({ params });
} else { } else {
@ -106,6 +106,8 @@ const handleOpen = function* handleOpen({ params }) {
if (params.token) { if (params.token) {
yield take(types.SERVER.SELECT_SUCCESS); yield take(types.SERVER.SELECT_SUCCESS);
yield RocketChat.connect({ server: host, user: { token: params.token } }); yield RocketChat.connect({ server: host, user: { token: params.token } });
yield take(types.LOGIN.SUCCESS);
yield navigate({ params });
} else { } else {
yield handleInviteLink({ params, requireLogin: true }); yield handleInviteLink({ params, requireLogin: true });
} }