Merge pull request #39 from lbryio/settings-page
settings persisted to redux store
This commit is contained in:
commit
a809826bf6
5 changed files with 12 additions and 8 deletions
|
@ -16,6 +16,7 @@
|
|||
"react-navigation-redux-helpers": "^1.0.1",
|
||||
"react-redux": "^5.0.3",
|
||||
"redux": "^3.6.0",
|
||||
"redux-logger": "3.0.6",
|
||||
"redux-persist": "^4.8.0",
|
||||
"redux-persist-transform-compress": "^4.2.0",
|
||||
"redux-persist-transform-filter": "0.0.10",
|
||||
|
|
|
@ -87,12 +87,13 @@ const store = createStore(
|
|||
const compressor = createCompressor();
|
||||
const saveClaimsFilter = createFilter('claims', ['byId', 'claimsByUri']);
|
||||
const subscriptionsFilter = createFilter('subscriptions', ['subscriptions']);
|
||||
const settingsFilter = createFilter('settings', ['clientSettings']);
|
||||
|
||||
const persistOptions = {
|
||||
whitelist: ['claims', 'subscriptions'],
|
||||
whitelist: ['claims', 'subscriptions', 'settings'],
|
||||
// Order is important. Needs to be compressed last or other transforms can't
|
||||
// read the data
|
||||
transforms: [saveClaimsFilter, subscriptionsFilter, compressor],
|
||||
transforms: [saveClaimsFilter, subscriptionsFilter, settingsFilter, compressor],
|
||||
debounce: 10000,
|
||||
storage: AsyncStorage
|
||||
};
|
||||
|
|
|
@ -13,7 +13,7 @@ reducers[ACTIONS.CLIENT_SETTING_CHANGED] = (state, action) => {
|
|||
const clientSettings = Object.assign({}, state.clientSettings);
|
||||
|
||||
clientSettings[key] = value;
|
||||
|
||||
|
||||
return Object.assign({}, state, {
|
||||
clientSettings,
|
||||
});
|
||||
|
|
|
@ -1512,9 +1512,10 @@ __d(function (global, require, module, exports, _dependencyMap) {
|
|||
var compressor = (0, _reduxPersistTransformCompress2.default)();
|
||||
var saveClaimsFilter = (0, _reduxPersistTransformFilter2.default)('claims', ['byId', 'claimsByUri']);
|
||||
var subscriptionsFilter = (0, _reduxPersistTransformFilter2.default)('subscriptions', ['subscriptions']);
|
||||
var settingsFilter = (0, _reduxPersistTransformFilter2.default)('settings', ['clientSettings']);
|
||||
var persistOptions = {
|
||||
whitelist: ['claims', 'subscriptions'],
|
||||
transforms: [saveClaimsFilter, subscriptionsFilter, compressor],
|
||||
whitelist: ['claims', 'subscriptions', 'settings'],
|
||||
transforms: [saveClaimsFilter, subscriptionsFilter, settingsFilter, compressor],
|
||||
debounce: 10000,
|
||||
storage: _reactNative.AsyncStorage
|
||||
};
|
||||
|
@ -1541,13 +1542,13 @@ __d(function (global, require, module, exports, _dependencyMap) {
|
|||
store: store,
|
||||
__source: {
|
||||
fileName: _jsxFileName,
|
||||
lineNumber: 109
|
||||
lineNumber: 110
|
||||
}
|
||||
},
|
||||
_react2.default.createElement(_AppNavigator2.default, {
|
||||
__source: {
|
||||
fileName: _jsxFileName,
|
||||
lineNumber: 110
|
||||
lineNumber: 111
|
||||
}
|
||||
})
|
||||
);
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
á…N†eº¸Îù‚ˆ™)5sCÊê
|
||||
őÚ¤
|
||||
’!’óĂŇW€mý6ű“
|
Loading…
Reference in a new issue