|
@@ -301,12 +301,13 @@ const getGQL = url => (
|
|
|
)
|
|
|
|
|
|
const actionFullRegister = (login, password) => (
|
|
|
- async (dispatch) => {
|
|
|
- let regId = await dispatch(actionRegister(login, password))
|
|
|
- if (regId) {
|
|
|
- dispatch(actionFullLogin(login, password))
|
|
|
- }
|
|
|
- }
|
|
|
+ {type: 'FULL_REGISTER', login, password}
|
|
|
+ // async (dispatch) => {
|
|
|
+ // let regId = await dispatch(actionRegister(login, password))
|
|
|
+ // if (regId) {
|
|
|
+ // dispatch(actionFullLogin(login, password))
|
|
|
+ // }
|
|
|
+ // }
|
|
|
)
|
|
|
|
|
|
|
|
@@ -435,10 +436,25 @@ function* loginWatcher() {
|
|
|
yield takeEvery('FULL_LOGIN', loginWorker)
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+function* registerWorker(action) {
|
|
|
+ const {login, password} = action
|
|
|
+ let regId = yield call(promiseWorker, actionRegister(login, password))
|
|
|
+ if (regId) {
|
|
|
+ yield put(actionFullLogin(login, password))
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+function* registerWatcher() {
|
|
|
+ yield takeEvery('FULL_REGISTER', registerWorker)
|
|
|
+}
|
|
|
+
|
|
|
function* rootSaga() {
|
|
|
yield all([
|
|
|
promiseWatcher(),
|
|
|
- loginWatcher()
|
|
|
+ loginWatcher(),
|
|
|
+ registerWatcher()
|
|
|
])
|
|
|
}
|
|
|
|