client/src/reducers/syncReducer.js
changeset 129 d48946d164c6
child 130 78246db1cbac
equal deleted inserted replaced
128:34a75bd8d0b9 129:d48946d164c6
       
     1 import * as types from '../constants/actionTypes';
       
     2 
       
     3 export const lastSync = (state = 0, action) => {
       
     4   switch (action.type) {
       
     5     case types.SYNC_SET_LAST_SYNC:
       
     6       return action.value;
       
     7     case types.AUTH_LOGOUT:
       
     8       return 0;
       
     9     default:
       
    10       return state;
       
    11   }
       
    12 }
       
    13 
       
    14 export const isSynchronizing = (state = false, action) => {
       
    15   switch (action.type) {
       
    16     case types.SYNC_DO_SYNC:
       
    17       return true;
       
    18     case types.SYNC_END_SYNC:
       
    19       return false;
       
    20     default:
       
    21       return state;
       
    22   }
       
    23 }