client/src/selectors/syncSelectors.js
author ymh <ymh.work@gmail.com>
Mon, 03 Sep 2018 11:57:58 +0200
changeset 153 de8d18c8251d
parent 134 be36eed5e6e0
child 168 ea92f4fe783d
permissions -rw-r--r--
Remove reference to bootstrap-sass after migration to bootstrap 4

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