client/src/selectors/syncSelectors.js
author salimr <riwad.salim@yahoo.fr>
Wed, 29 Aug 2018 11:02:36 +0200
changeset 150 97536386b397
parent 134 be36eed5e6e0
child 168 ea92f4fe783d
permissions -rw-r--r--
Improve Modals display and sessions list

// 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)