| author | ymh <ymh.work@gmail.com> |
| Tue, 29 Mar 2022 11:23:56 +0200 | |
| changeset 211 | 244a90638e80 |
| parent 130 | 78246db1cbac |
| permissions | -rw-r--r-- |
|
129
d48946d164c6
Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1 |
import * as types from '../constants/actionTypes'; |
|
d48946d164c6
Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2 |
|
|
d48946d164c6
Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3 |
export const lastSync = (state = 0, action) => { |
|
d48946d164c6
Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4 |
switch (action.type) { |
|
d48946d164c6
Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5 |
case types.SYNC_SET_LAST_SYNC: |
|
d48946d164c6
Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6 |
return action.value; |
|
d48946d164c6
Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7 |
case types.AUTH_LOGOUT: |
|
d48946d164c6
Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8 |
return 0; |
|
d48946d164c6
Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
9 |
default: |
|
d48946d164c6
Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
10 |
return state; |
|
d48946d164c6
Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
11 |
} |
|
d48946d164c6
Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
12 |
} |
|
d48946d164c6
Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
13 |
|
|
d48946d164c6
Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
14 |
export const isSynchronizing = (state = false, action) => { |
|
d48946d164c6
Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
15 |
switch (action.type) { |
|
130
78246db1cbac
make synchronization recurent, improve synchronization status display
ymh <ymh.work@gmail.com>
parents:
129
diff
changeset
|
16 |
case types.SYNC_START_SYNC: |
|
129
d48946d164c6
Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
17 |
return true; |
|
d48946d164c6
Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
18 |
case types.SYNC_END_SYNC: |
|
d48946d164c6
Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
19 |
return false; |
|
d48946d164c6
Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
20 |
default: |
|
d48946d164c6
Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
21 |
return state; |
|
d48946d164c6
Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
22 |
} |
|
d48946d164c6
Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
23 |
} |