From f0284d3e79107a8a570db93a742ed42cc5414e71 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 3 Oct 2018 12:49:48 -0400 Subject: [PATCH 1/5] remove claims from redux-persist --- src/renderer/page/file/view.jsx | 1 - src/renderer/redux/selectors/content.js | 11 +++++------ src/renderer/store.js | 9 ++++++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/renderer/page/file/view.jsx b/src/renderer/page/file/view.jsx index b9ad65954..828991bca 100644 --- a/src/renderer/page/file/view.jsx +++ b/src/renderer/page/file/view.jsx @@ -81,7 +81,6 @@ class FilePage extends React.Component { this.checkSubscription(this.props); setViewed(uri); - console.log('claim', this.props.claim); } componentWillReceiveProps(nextProps: Props) { diff --git a/src/renderer/redux/selectors/content.js b/src/renderer/redux/selectors/content.js index a685fcde7..f5cc1a7b2 100644 --- a/src/renderer/redux/selectors/content.js +++ b/src/renderer/redux/selectors/content.js @@ -50,20 +50,19 @@ export const makeSelectHistoryForPage = page => createSelector(selectState, selectClaimsByUri, (state, claimsByUri) => { const left = page * HISTORY_ITEMS_PER_PAGE; const historyItems = state.history.slice(left, left + HISTORY_ITEMS_PER_PAGE); - + // See if we have the claim info for the uris in your history // If not, it will need to be fetched in the component - return historyItems.map((historyItem) => { + return historyItems.map(historyItem => { const { uri, lastViewed } = historyItem; const claimAtUri = claimsByUri[uri]; - + if (claimAtUri) { - return { lastViewed, uri, ...claimAtUri } + return { lastViewed, uri, ...claimAtUri }; } else { - console.log("jsut returning item") return historyItem; } - }) + }); }); export const makeSelectHistoryForUri = uri => diff --git a/src/renderer/store.js b/src/renderer/store.js index fdb1be5c9..21a415c07 100644 --- a/src/renderer/store.js +++ b/src/renderer/store.js @@ -97,7 +97,10 @@ const store = createStore( ); 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 contentFilter = createFilter('content', ['positions', 'history']); @@ -105,10 +108,10 @@ const contentFilter = createFilter('content', ['positions', 'history']); const walletFilter = createFilter('wallet', ['receiveAddress']); 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 // read the data - transforms: [saveClaimsFilter, subscriptionsFilter, walletFilter, contentFilter, compressor], + transforms: [subscriptionsFilter, walletFilter, contentFilter, compressor], debounce: 10000, storage: localForage, }; -- 2.45.2 From 9c74cd7f64e5fe7266ce1371e508caeb133d95c4 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 4 Oct 2018 00:11:08 -0400 Subject: [PATCH 2/5] general css fixes --- .eslintrc.json | 4 +- .../component/transactionListRecent/view.jsx | 4 ++ src/renderer/component/userHistory/view.jsx | 28 ++++++----- .../component/userHistoryItem/view.jsx | 33 ++++++------- src/renderer/page/help/view.jsx | 2 +- src/renderer/scss/_gui.scss | 14 +----- src/renderer/scss/_vars.scss | 6 ++- src/renderer/scss/all.scss | 2 + src/renderer/scss/component/_button.scss | 2 - src/renderer/scss/component/_card.scss | 3 +- src/renderer/scss/component/_item-list.scss | 26 +++++++++++ src/renderer/scss/component/_search.scss | 3 -- src/renderer/scss/component/_table.scss | 46 ------------------- src/renderer/scss/component/_time.scss | 9 ++++ static/themes/dark.css | 4 +- 15 files changed, 82 insertions(+), 104 deletions(-) create mode 100644 src/renderer/scss/component/_item-list.scss create mode 100644 src/renderer/scss/component/_time.scss diff --git a/.eslintrc.json b/.eslintrc.json index bb482f3f2..19f686074 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -40,6 +40,8 @@ "react/require-default-props": 0, "react/jsx-closing-tag-location": 0, "jsx-a11y/no-noninteractive-element-to-interactive-role": 0, - "class-methods-use-this": 0 + "class-methods-use-this": 0, + "jsx-a11y/interactive-supports-focus": 0, + "jsx-a11y/click-events-have-key-events": 0 } } diff --git a/src/renderer/component/transactionListRecent/view.jsx b/src/renderer/component/transactionListRecent/view.jsx index 325bbc1cb..fefcab356 100644 --- a/src/renderer/component/transactionListRecent/view.jsx +++ b/src/renderer/component/transactionListRecent/view.jsx @@ -24,6 +24,10 @@ class TransactionListRecent extends React.PureComponent { return (
{__('Recent Transactions')}
+
+ {__('To view all of your transactions, navigate to the')}{' '} +
{fetchingTransactions && (
diff --git a/src/renderer/component/userHistory/view.jsx b/src/renderer/component/userHistory/view.jsx index ae8f4b532..55b040d74 100644 --- a/src/renderer/component/userHistory/view.jsx +++ b/src/renderer/component/userHistory/view.jsx @@ -117,21 +117,19 @@ class UserHistoryPage extends React.PureComponent { />
{!!history.length && ( - - - {history.map(item => ( - { - this.onSelect(item.uri); - }} - /> - ))} - -
+
+ {history.map(item => ( + { + this.onSelect(item.uri); + }} + /> + ))} +
)} {pageCount > 1 && ( diff --git a/src/renderer/component/userHistoryItem/view.jsx b/src/renderer/component/userHistoryItem/view.jsx index de35a919b..b5ae79808 100644 --- a/src/renderer/component/userHistoryItem/view.jsx +++ b/src/renderer/component/userHistoryItem/view.jsx @@ -36,27 +36,24 @@ class UserHistoryItem extends React.PureComponent { } return ( - - - - - {moment(lastViewed).from(moment())} - {title} - -