client/src/reducers/miscReducer.js
author ymh <ymh.work@gmail.com>
Thu, 03 Aug 2017 17:33:00 +0200
changeset 134 be36eed5e6e0
parent 129 d48946d164c6
permissions -rw-r--r--
add menu to change current group and create a new group
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
72
7634b424f426 Add checkbox to add not on enter key.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
     1
import * as types from '../constants/actionTypes';
7634b424f426 Add checkbox to add not on enter key.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
     2
7634b424f426 Add checkbox to add not on enter key.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
     3
export const autoSubmit = (state = false, action) => {
7634b424f426 Add checkbox to add not on enter key.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
     4
  switch (action.type) {
7634b424f426 Add checkbox to add not on enter key.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
     5
    case types.USER_TOGGLE_AUTO_SUBMIT:
7634b424f426 Add checkbox to add not on enter key.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
     6
      return action.value;
7634b424f426 Add checkbox to add not on enter key.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
     7
    default:
7634b424f426 Add checkbox to add not on enter key.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
     8
      return state;
7634b424f426 Add checkbox to add not on enter key.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
     9
  }
7634b424f426 Add checkbox to add not on enter key.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
    10
}
7634b424f426 Add checkbox to add not on enter key.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
    11
129
d48946d164c6 Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents: 107
diff changeset
    12
export const online = (state = false, action) => {
107
e6f85e26b08c Confirm logout when pending requests, try to purge offline.outbox
Alexandre Segura <mex.zktk@gmail.com>
parents: 72
diff changeset
    13
  switch (action.type) {
129
d48946d164c6 Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents: 107
diff changeset
    14
    case types.STATUS_ONLINE:
d48946d164c6 Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents: 107
diff changeset
    15
      return true;
d48946d164c6 Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents: 107
diff changeset
    16
    case types.STATUS_OFFLINE:
d48946d164c6 Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents: 107
diff changeset
    17
      return false;
107
e6f85e26b08c Confirm logout when pending requests, try to purge offline.outbox
Alexandre Segura <mex.zktk@gmail.com>
parents: 72
diff changeset
    18
    default:
e6f85e26b08c Confirm logout when pending requests, try to purge offline.outbox
Alexandre Segura <mex.zktk@gmail.com>
parents: 72
diff changeset
    19
      return state;
e6f85e26b08c Confirm logout when pending requests, try to purge offline.outbox
Alexandre Segura <mex.zktk@gmail.com>
parents: 72
diff changeset
    20
  }
129
d48946d164c6 Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents: 107
diff changeset
    21
107
e6f85e26b08c Confirm logout when pending requests, try to purge offline.outbox
Alexandre Segura <mex.zktk@gmail.com>
parents: 72
diff changeset
    22
}