client/src/reducers/miscReducer.js
author ymh <ymh.work@gmail.com>
Fri, 30 Nov 2018 10:53:15 +0100
changeset 183 f8f3af9e5c83
parent 129 d48946d164c6
permissions -rw-r--r--
Change the settings to avoid using Session authentication for rest framework as it raise exceptions in case client and backend are on the same domain On the filter, adapt to take into account new version of django_filters
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
}