diff -r 6f3078f7fd47 -r be36eed5e6e0 client/src/selectors/syncSelectors.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/selectors/syncSelectors.js Thu Aug 03 17:33:00 2017 +0200 @@ -0,0 +1,10 @@ +// selectors linked to syncronization status +import { ActionEnum } from '../constants'; + +export const getLastSync = state => state.getIn(['authStatus', 'lastSync']) || 0 + +export const isSynchronizing = state => state.getIn(['status', 'isSynchronizing']) + +export const isSynchronized = state => + state.get('notes').every((n) => n.get('action')===ActionEnum.NONE) && + state.get('sessions').every((n) => n.get('action')===ActionEnum.NONE)