--- a/client/src/sagas/syncSaga.js Mon Jul 31 23:18:38 2017 +0200
+++ b/client/src/sagas/syncSaga.js Tue Aug 01 12:20:14 2017 +0200
@@ -1,10 +1,11 @@
-import { put, take, all, select, spawn, race, call} from 'redux-saga/effects'
+import { put, take, all, select, spawn, race, call, fork} from 'redux-saga/effects'
import { delay } from 'redux-saga';
import * as types from '../constants/actionTypes';
import { getLastSync, getOnline } from './selectors';
import moment from 'moment';
import { startSynchronize, endSynchronize, updateLastSync } from '../actions/syncActions';
import { forceSync } from '../actions/networkActions';
+import { groupLoadAsync } from '../actions/groupActions';
import SessionSynchronizer from './SessionSyncronizer';
import NoteSynchronizer from './NoteSyncronizer';
import config from '../config';
@@ -39,10 +40,15 @@
}
+function* doLoadGroup() {
+ yield put(groupLoadAsync());
+}
+
function* watchDoSync(context) {
while (true) {
yield take(types.SYNC_DO_SYNC);
- yield spawn(doSync, context);
+ yield spawn(doSync, context); //we use spawn + take, because we do not want it to be interupted
+ yield fork(doLoadGroup);
yield take(types.SYNC_END_SYNC);
}
}