remove claims from redux-persist cache #1996
3 changed files with 11 additions and 10 deletions
|
@ -81,7 +81,6 @@ class FilePage extends React.Component<Props> {
|
||||||
this.checkSubscription(this.props);
|
this.checkSubscription(this.props);
|
||||||
|
|
||||||
setViewed(uri);
|
setViewed(uri);
|
||||||
console.log('claim', this.props.claim);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps: Props) {
|
componentWillReceiveProps(nextProps: Props) {
|
||||||
|
|
|
@ -53,17 +53,16 @@ export const makeSelectHistoryForPage = page =>
|
||||||
|
|
||||||
// See if we have the claim info for the uris in your history
|
// See if we have the claim info for the uris in your history
|
||||||
// If not, it will need to be fetched in the component
|
// If not, it will need to be fetched in the component
|
||||||
return historyItems.map((historyItem) => {
|
return historyItems.map(historyItem => {
|
||||||
const { uri, lastViewed } = historyItem;
|
const { uri, lastViewed } = historyItem;
|
||||||
const claimAtUri = claimsByUri[uri];
|
const claimAtUri = claimsByUri[uri];
|
||||||
|
|
||||||
if (claimAtUri) {
|
if (claimAtUri) {
|
||||||
return { lastViewed, uri, ...claimAtUri }
|
return { lastViewed, uri, ...claimAtUri };
|
||||||
} else {
|
} else {
|
||||||
console.log("jsut returning item")
|
|
||||||
return historyItem;
|
return historyItem;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
export const makeSelectHistoryForUri = uri =>
|
export const makeSelectHistoryForUri = uri =>
|
||||||
|
|
|
@ -97,7 +97,10 @@ const store = createStore(
|
||||||
);
|
);
|
||||||
|
|
||||||
const compressor = createCompressor();
|
const compressor = createCompressor();
|
||||||
const saveClaimsFilter = createFilter('claims', ['byId', 'claimsByUri']);
|
// Removing claims from redux-persist to see if it solves https://github.com/lbryio/lbry-desktop/issues/1983
|
||||||
|
// We were caching so much data the app was locking up
|
||||||
|
// We can't add this back until we can perform this in a non-blocking way
|
||||||
|
// const saveClaimsFilter = createFilter('claims', ['byId', 'claimsByUri']);
|
||||||
const subscriptionsFilter = createFilter('subscriptions', ['subscriptions']);
|
const subscriptionsFilter = createFilter('subscriptions', ['subscriptions']);
|
||||||
const contentFilter = createFilter('content', ['positions', 'history']);
|
const contentFilter = createFilter('content', ['positions', 'history']);
|
||||||
|
|
||||||
|
@ -105,10 +108,10 @@ const contentFilter = createFilter('content', ['positions', 'history']);
|
||||||
const walletFilter = createFilter('wallet', ['receiveAddress']);
|
const walletFilter = createFilter('wallet', ['receiveAddress']);
|
||||||
|
|
||||||
const persistOptions = {
|
const persistOptions = {
|
||||||
whitelist: ['claims', 'subscriptions', 'publish', 'wallet', 'content'],
|
whitelist: ['subscriptions', 'publish', 'wallet', 'content'],
|
||||||
// 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: [saveClaimsFilter, subscriptionsFilter, walletFilter, contentFilter, compressor],
|
transforms: [subscriptionsFilter, walletFilter, contentFilter, compressor],
|
||||||
debounce: 10000,
|
debounce: 10000,
|
||||||
storage: localForage,
|
storage: localForage,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue