persist fileSort options when the app is closed

This commit is contained in:
Sean Yesmunt 2018-10-25 02:01:32 -04:00
parent 50264c3ab2
commit 78fe88eed7

View file

@ -103,15 +103,19 @@ const compressor = createCompressor();
// const saveClaimsFilter = createFilter('claims', ['byId', 'claimsByUri']); // const saveClaimsFilter = createFilter('claims', ['byId', 'claimsByUri']);
const subscriptionsFilter = createFilter('subscriptions', ['subscriptions', 'unread', 'viewMode']); const subscriptionsFilter = createFilter('subscriptions', ['subscriptions', 'unread', 'viewMode']);
const contentFilter = createFilter('content', ['positions', 'history']); const contentFilter = createFilter('content', ['positions', 'history']);
const fileInfoFilter = createFilter('fileInfo', [
'fileListPublishedSort',
'fileListDownloadedSort',
'fileListSubscriptionSort',
]);
// We only need to persist the receiveAddress for the wallet // We only need to persist the receiveAddress for the wallet
const walletFilter = createFilter('wallet', ['receiveAddress']); const walletFilter = createFilter('wallet', ['receiveAddress']);
const persistOptions = { const persistOptions = {
whitelist: ['subscriptions', 'publish', 'wallet', 'content'], whitelist: ['subscriptions', 'publish', 'wallet', 'content', 'fileInfo'],
// Order is important. Needs to be compressed last or other transforms can't // Order is important. Needs to be compressed last or other transforms can't
// read the data // read the data
transforms: [subscriptionsFilter, walletFilter, contentFilter, compressor], transforms: [subscriptionsFilter, walletFilter, contentFilter, fileInfoFilter, compressor],
debounce: 10000, debounce: 10000,
storage: localForage, storage: localForage,
}; };