client/src/sagas/networkSaga.js
changeset 130 78246db1cbac
parent 129 d48946d164c6
child 134 be36eed5e6e0
--- a/client/src/sagas/networkSaga.js	Fri Jul 28 19:40:35 2017 +0200
+++ b/client/src/sagas/networkSaga.js	Sun Jul 30 01:02:09 2017 +0200
@@ -4,7 +4,7 @@
 import * as persistConstants  from 'redux-persist/constants';
 import jwt_decode from 'jwt-decode';
 import moment from 'moment';
-import { delay } from './utils';
+import { delay } from 'redux-saga';
 import { setOnlineStatus } from '../actions/networkActions';
 import { getToken } from './selectors';
 
@@ -94,11 +94,11 @@
   yield take(persistConstants.REHYDRATE);
 
   while (true) {
-    yield race([
-      all([call(pollData, context), call(callDelay, context)]),
-      take(types.AUTH_LOGOUT),
-      take(types.AUTH_LOGIN_SUCCESS)
-    ]);
+    yield race({
+      poll: all([call(pollData, context), call(callDelay, context)]),
+      logout: take(types.AUTH_LOGOUT),
+      login: take(types.AUTH_LOGIN_SUCCESS)
+    });
   }
 }