...
|
...
|
@@ -2,6 +2,9 @@ |
|
|
|
|
|
import ReactNative from 'react-native';
|
|
|
import InterestService from '../../services/InterestService';
|
|
|
import store from 'react-native-simple-store';
|
|
|
|
|
|
const YH_RNCacheTypeInterestList = 'YH_RNCacheTypeInterestList';
|
|
|
|
|
|
const {
|
|
|
SET_TYPE,
|
...
|
...
|
@@ -37,8 +40,12 @@ export function loadCachedInterestList() { |
|
|
return;
|
|
|
}
|
|
|
|
|
|
ReactNative.NativeModules.YH_ClassifyHelper.loadCachedInterestData()
|
|
|
store.get(YH_RNCacheTypeInterestList)
|
|
|
.then(data => {
|
|
|
if (!data) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
dispatch({
|
|
|
type: LOAD_CACHED_INTEREST_LIST,
|
|
|
payload: data,
|
...
|
...
|
@@ -112,12 +119,9 @@ export function interestList(reload=false) { |
|
|
let list = [...oldList, ...payload.list];
|
|
|
payload.list = list;
|
|
|
} else {
|
|
|
ReactNative.NativeModules.YH_ClassifyHelper.updateCachedInterestData(payload.list)
|
|
|
store.save(YH_RNCacheTypeInterestList, payload.list)
|
|
|
.then(data => {
|
|
|
dispatch({
|
|
|
type: LOAD_CACHED_INTEREST_LIST,
|
|
|
payload: payload.list,
|
|
|
});
|
|
|
|
|
|
})
|
|
|
.catch(error => {
|
|
|
|
...
|
...
|
|