From bc59a429d36d615caf5f29614d11ae1c10b25b0c Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 30 Oct 2018 14:09:41 -0400 Subject: [PATCH 01/15] lbrynet 0.30.1 rc1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a5583bd32..829fbefc6 100644 --- a/package.json +++ b/package.json @@ -134,7 +134,7 @@ "yarn": "^1.3" }, "lbrySettings": { - "lbrynetDaemonVersion": "0.30.0", + "lbrynetDaemonVersion": "0.30.1rc1", "lbrynetDaemonUrlTemplate": "https://github.com/lbryio/lbry/releases/download/vDAEMONVER/lbrynet-OSNAME.zip", "lbrynetDaemonDir": "static/daemon", "lbrynetDaemonFileName": "lbrynet" -- 2.43.4 From a490a30798ca9846674b82972d42b39adb914911 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 5 Nov 2018 16:53:15 -0500 Subject: [PATCH 02/15] v0.26.0-rc.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 829fbefc6..abc498b33 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "LBRY", - "version": "0.25.1", + "version": "0.26.0-rc.4", "description": "A browser for the LBRY network, a digital marketplace controlled by its users.", "keywords": [ "lbry" -- 2.43.4 From 01db231ada19a52620136db75bdd73fabe8c604b Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Fri, 2 Nov 2018 15:31:40 -0400 Subject: [PATCH 03/15] fix meta style color --- src/renderer/scss/_gui.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/scss/_gui.scss b/src/renderer/scss/_gui.scss index 751fc8463..4a143c1d3 100644 --- a/src/renderer/scss/_gui.scss +++ b/src/renderer/scss/_gui.scss @@ -302,7 +302,7 @@ p:not(:first-of-type) { } .meta { - color: $lbry-gray-1; + color: $lbry-gray-5; font-size: 0.8em; } -- 2.43.4 From 02457ca11caf751241355d8d51b82373a1b45211 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Fri, 2 Nov 2018 16:38:59 -0400 Subject: [PATCH 04/15] remove console.log --- src/renderer/redux/actions/publish.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/renderer/redux/actions/publish.js b/src/renderer/redux/actions/publish.js index 4894e6200..e2aa89f1e 100644 --- a/src/renderer/redux/actions/publish.js +++ b/src/renderer/redux/actions/publish.js @@ -313,7 +313,6 @@ export const doCheckPendingPublishes = () => (dispatch: Dispatch, getSta const checkFileList = () => { Lbry.claim_list_mine().then(claims => { - console.log('check'); claims.forEach(claim => { // If it's confirmed, check if it was pending previously if (claim.confirmations > 0 && pendingById[claim.claim_id]) { -- 2.43.4 From d5a19eb530779c783aa57554a56c4481cc58c49e Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 6 Nov 2018 10:13:12 -0500 Subject: [PATCH 05/15] fix selected color on history list in dark mode --- src/renderer/scss/component/_button.scss | 1 + src/renderer/scss/themes/_dark.scss | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/renderer/scss/component/_button.scss b/src/renderer/scss/component/_button.scss index a12d1a77e..b40e17767 100644 --- a/src/renderer/scss/component/_button.scss +++ b/src/renderer/scss/component/_button.scss @@ -153,6 +153,7 @@ font-size: 1em; min-width: 0; text-align: left; + transition: none; } &.btn--no-style { diff --git a/src/renderer/scss/themes/_dark.scss b/src/renderer/scss/themes/_dark.scss index 6248f3e9f..870921cad 100644 --- a/src/renderer/scss/themes/_dark.scss +++ b/src/renderer/scss/themes/_dark.scss @@ -96,10 +96,16 @@ html[data-theme='dark'] { } } + // + // SEARCH + // .search__top { background-color: rgba($lbry-white, 0.15); } + // + // TABLE + // table.table, .markdown-preview table { thead { @@ -117,10 +123,18 @@ html[data-theme='dark'] { } } + // + // ITEM LIST + // .item-list { background-color: rgba($lbry-white, 0.1); } + .item-list__item--selected { + background-color: $lbry-black; + color: $lbry-white; + } + .item-list__item:not(:last-of-type) { border-bottom: 1px solid rgba($lbry-gray-1, 0.1); } -- 2.43.4 From 7785de2a662de57740a9d3265166ae2b69331e6d Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 6 Nov 2018 16:27:26 -0500 Subject: [PATCH 06/15] fix text wrapping on file description --- src/renderer/scss/component/_markdown-preview.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/renderer/scss/component/_markdown-preview.scss b/src/renderer/scss/component/_markdown-preview.scss index 845609efe..62e5bb390 100644 --- a/src/renderer/scss/component/_markdown-preview.scss +++ b/src/renderer/scss/component/_markdown-preview.scss @@ -1,5 +1,6 @@ .markdown-preview { margin: 0; + word-break: break-all; // Headers h1, -- 2.43.4 From 336f398ce1e78421960d3d221d9205babfa717f9 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 6 Nov 2018 16:54:28 -0500 Subject: [PATCH 07/15] remove shapeshift --- src/renderer/page/getCredits/view.jsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/renderer/page/getCredits/view.jsx b/src/renderer/page/getCredits/view.jsx index e7fec2a4b..f22ea0fd1 100644 --- a/src/renderer/page/getCredits/view.jsx +++ b/src/renderer/page/getCredits/view.jsx @@ -1,13 +1,18 @@ import React from 'react'; import Button from 'component/button'; import RewardSummary from 'component/rewardSummary'; -import ShapeShift from 'component/shapeShift'; +// import ShapeShift from 'component/shapeShift'; import Page from 'component/page'; const GetCreditsPage = () => ( - + {/* + Removing Shapeshift after they switched to user accounts + Ideally most of the redux logic should be able to be re-used if we switch to another company + Or find a way to use ShapShift with an account? + + */}
{__('More ways to get LBRY Credits')}
-- 2.43.4 From 3de1298d25bb8e61dbb4862bc477db82ee704563 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 7 Nov 2018 11:03:42 -0500 Subject: [PATCH 08/15] use date estimate --- package.json | 2 +- src/renderer/component/app/index.js | 8 +++++++- src/renderer/component/app/view.jsx | 10 ++++++++++ src/renderer/component/dateTime/view.jsx | 23 ++++++++++++----------- yarn.lock | 4 ++-- 5 files changed, 32 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index a5583bd32..76057d5d2 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "formik": "^0.10.4", "hast-util-sanitize": "^1.1.2", "keytar": "^4.2.1", - "lbry-redux": "lbryio/lbry-redux#aa10240bc1e90dff299821e31a88edcb4c5fd295", + "lbry-redux": "lbryio/lbry-redux#6f1e3b054fda5a818eacf778393022f96082c387", "lbryinc": "lbryio/lbryinc#7a458ea13ceceffa0191e73139f94e5c953f22b1", "localforage": "^1.7.1", "mammoth": "^1.4.6", diff --git a/src/renderer/component/app/index.js b/src/renderer/component/app/index.js index b5c8a2218..85b6ab37c 100644 --- a/src/renderer/component/app/index.js +++ b/src/renderer/component/app/index.js @@ -1,5 +1,10 @@ import { connect } from 'react-redux'; -import { selectPageTitle, selectHistoryIndex, selectActiveHistoryEntry } from 'lbry-redux'; +import { + selectPageTitle, + selectHistoryIndex, + selectActiveHistoryEntry, + doUpdateBlockHeight, +} from 'lbry-redux'; import { doRecordScroll } from 'redux/actions/navigation'; import { selectUser } from 'lbryinc'; import { doAlertError } from 'redux/actions/app'; @@ -17,6 +22,7 @@ const select = state => ({ const perform = dispatch => ({ alertError: errorList => dispatch(doAlertError(errorList)), recordScroll: scrollPosition => dispatch(doRecordScroll(scrollPosition)), + updateBlockHeight: () => dispatch(doUpdateBlockHeight()), }); export default connect( diff --git a/src/renderer/component/app/view.jsx b/src/renderer/component/app/view.jsx index c083ba695..6aebf7706 100644 --- a/src/renderer/component/app/view.jsx +++ b/src/renderer/component/app/view.jsx @@ -8,6 +8,8 @@ import SideBar from 'component/sideBar'; import Header from 'component/header'; import { openContextMenu } from '../../util/contextMenu'; +const TWO_POINT_FIVE_MINUTES = 1000 * 60 * 2.5; + type Props = { alertError: (string | {}) => void, recordScroll: number => void, @@ -15,6 +17,7 @@ type Props = { currentPageAttributes: { path: string, scrollY: number }, pageTitle: ?string, theme: string, + updateBlockHeight: () => void, }; class App extends React.PureComponent { @@ -38,6 +41,8 @@ class App extends React.PureComponent { } componentDidMount() { + const { updateBlockHeight } = this.props; + const mainContent = document.getElementById('content'); this.mainContent = mainContent; @@ -46,6 +51,11 @@ class App extends React.PureComponent { } ReactModal.setAppElement('#window'); // fuck this + + updateBlockHeight(); + setInterval(() => { + updateBlockHeight(); + }, TWO_POINT_FIVE_MINUTES); } componentWillReceiveProps(props: Props) { diff --git a/src/renderer/component/dateTime/view.jsx b/src/renderer/component/dateTime/view.jsx index 7049b223e..6a5eb55a0 100644 --- a/src/renderer/component/dateTime/view.jsx +++ b/src/renderer/component/dateTime/view.jsx @@ -23,27 +23,28 @@ class DateTime extends React.PureComponent { }; componentWillMount() { - this.refreshDate(this.props); + // this.refreshDate(this.props); } - componentWillReceiveProps(props) { - this.refreshDate(props); + componentWillReceiveProps() { + // this.refreshDate(props); } - refreshDate(props) { - const { block, date, fetchBlock } = props; - if (block && date === undefined) { - fetchBlock(block); - } - } + // Removing this for performance reasons. Can be un-commented once block_show is better with large numbers of calls + // Or the date is included in the claim + // + // refreshDate(props: Props) { + // const { block, date, fetchBlock } = props; + // if (block && date === undefined) { + // fetchBlock(block); + // } + // } render() { const { date, formatOptions, timeAgo } = this.props; const show = this.props.show || DateTime.SHOW_BOTH; const locale = app.i18n.getLocale(); - // If !date, it's currently being fetched - if (timeAgo) { return date ? {moment(date).from(moment())} : ; } diff --git a/yarn.lock b/yarn.lock index 99f767bb8..273e8a3d8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5670,9 +5670,9 @@ lbry-redux@lbryio/lbry-redux#2375860d6269d0369418879c2531b1d48c4e47f2: proxy-polyfill "0.1.6" reselect "^3.0.0" -lbry-redux@lbryio/lbry-redux#aa10240bc1e90dff299821e31a88edcb4c5fd295: +lbry-redux@lbryio/lbry-redux#6f1e3b054fda5a818eacf778393022f96082c387: version "0.0.1" - resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/aa10240bc1e90dff299821e31a88edcb4c5fd295" + resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/6f1e3b054fda5a818eacf778393022f96082c387" dependencies: proxy-polyfill "0.1.6" reselect "^3.0.0" -- 2.43.4 From e0b31d464d4ff0a0d947a0d4943562b281a74280 Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Wed, 7 Nov 2018 11:30:41 -0500 Subject: [PATCH 09/15] windows daemon process checks Check for running daemon without arguments on Windows --- src/main/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/index.js b/src/main/index.js index 46d696308..0da679b09 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -64,7 +64,9 @@ if (isDev) { } app.on('ready', async () => { - const processList = await findProcess('name', 'lbrynet start'); + const processListArgs = process.platform === 'win32' ? 'lbrynet' : 'lbrynet start'; + const processList = await findProcess('name', processListArgs); + const isDaemonRunning = processList.length > 0; if (!isDaemonRunning) { -- 2.43.4 From 2c9c174ed8ada9b7b8b941143de411f40b1b0e64 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 7 Nov 2018 14:35:47 -0500 Subject: [PATCH 10/15] call claim_list_mine on page entry and add refresh button --- .../component/transactionList/view.jsx | 50 +++++++-------- .../component/transactionListRecent/index.js | 2 + .../component/transactionListRecent/view.jsx | 62 ++++++++++++------- src/renderer/page/transactionHistory/index.js | 2 + src/renderer/page/transactionHistory/view.jsx | 36 ++++++++--- 5 files changed, 92 insertions(+), 60 deletions(-) diff --git a/src/renderer/component/transactionList/view.jsx b/src/renderer/component/transactionList/view.jsx index c5f043d89..f0503d76b 100644 --- a/src/renderer/component/transactionList/view.jsx +++ b/src/renderer/component/transactionList/view.jsx @@ -82,7 +82,7 @@ class TransactionList extends React.PureComponent { )} {!slim && !!transactionList.length && ( -
+
{ filters={['nout']} defaultPath={__('lbry-transactions-history')} /> + {!slim && ( + + } + > + {transactionTypes.map(tt => ( + + ))} + + )}
)} - {!slim && ( -
- - } - > - {transactionTypes.map(tt => ( - - ))} - -
- )} {!!transactionList.length && ( diff --git a/src/renderer/component/transactionListRecent/index.js b/src/renderer/component/transactionListRecent/index.js index f4890679f..bb4bdb5b2 100644 --- a/src/renderer/component/transactionListRecent/index.js +++ b/src/renderer/component/transactionListRecent/index.js @@ -4,6 +4,7 @@ import { selectRecentTransactions, selectHasTransactions, selectIsFetchingTransactions, + doFetchClaimListMine, } from 'lbry-redux'; import TransactionListRecent from './view'; @@ -15,6 +16,7 @@ const select = state => ({ const perform = dispatch => ({ fetchTransactions: () => dispatch(doFetchTransactions()), + fetchMyClaims: () => dispatch(doFetchClaimListMine()), }); export default connect( diff --git a/src/renderer/component/transactionListRecent/view.jsx b/src/renderer/component/transactionListRecent/view.jsx index fefcab356..3462a4d7f 100644 --- a/src/renderer/component/transactionListRecent/view.jsx +++ b/src/renderer/component/transactionListRecent/view.jsx @@ -1,5 +1,5 @@ // @flow -import React from 'react'; +import React, { Fragment } from 'react'; import BusyIndicator from 'component/common/busy-indicator'; import Button from 'component/button'; import TransactionList from 'component/transactionList'; @@ -11,44 +11,58 @@ type Props = { fetchingTransactions: boolean, hasTransactions: boolean, transactions: Array, + fetchMyClaims: () => void, }; class TransactionListRecent extends React.PureComponent { componentDidMount() { - this.props.fetchTransactions(); + const { fetchMyClaims, fetchTransactions } = this.props; + + fetchMyClaims(); + fetchTransactions(); } render() { - const { fetchingTransactions, hasTransactions, transactions } = this.props; - + const { fetchingTransactions, hasTransactions, transactions, fetchTransactions } = this.props; return (
-
{__('Recent Transactions')}
+
+ {__('Recent Transactions')} +
+
+
{__('To view all of your transactions, navigate to the')}{' '}
- {fetchingTransactions && ( -
- -
- )} - {!fetchingTransactions && ( - - )} + {fetchingTransactions && + !hasTransactions && ( +
+ +
+ )} {hasTransactions && ( -
-
+
+
+ )}
); diff --git a/src/renderer/page/transactionHistory/index.js b/src/renderer/page/transactionHistory/index.js index 33af4fc09..92006a6c5 100644 --- a/src/renderer/page/transactionHistory/index.js +++ b/src/renderer/page/transactionHistory/index.js @@ -3,6 +3,7 @@ import { doFetchTransactions, selectTransactionItems, selectIsFetchingTransactions, + doFetchClaimListMine, } from 'lbry-redux'; import TransactionHistoryPage from './view'; @@ -13,6 +14,7 @@ const select = state => ({ const perform = dispatch => ({ fetchTransactions: () => dispatch(doFetchTransactions()), + fetchMyClaims: () => dispatch(doFetchClaimListMine()), }); export default connect( diff --git a/src/renderer/page/transactionHistory/view.jsx b/src/renderer/page/transactionHistory/view.jsx index 365f937ad..0c91fd021 100644 --- a/src/renderer/page/transactionHistory/view.jsx +++ b/src/renderer/page/transactionHistory/view.jsx @@ -1,25 +1,41 @@ +// @flow import React from 'react'; import BusyIndicator from 'component/common/busy-indicator'; import TransactionList from 'component/transactionList'; import Page from 'component/page'; +import Button from 'component/button'; -class TransactionHistoryPage extends React.PureComponent { - componentWillMount() { - this.props.fetchTransactions(); +type Props = { + fetchMyClaims: () => void, + fetchTransactions: () => void, + fetchingTransactions: boolean, + transactions: Array<{}>, +}; + +class TransactionHistoryPage extends React.PureComponent { + componentDidMount() { + const { fetchMyClaims, fetchTransactions } = this.props; + + fetchMyClaims(); + fetchTransactions(); } render() { - const { fetchingTransactions, transactions } = this.props; + const { fetchingTransactions, transactions, fetchTransactions } = this.props; return (
-
-

{__('Transaction History')}

+
+ {__('Transaction History')} +
+
{fetchingTransactions && !transactions.length ? (
-- 2.43.4 From 1fca9e289a3dc2bb0377eaf5027999db71dd6166 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 7 Nov 2018 15:13:39 -0500 Subject: [PATCH 11/15] update deps --- package.json | 1 - yarn.lock | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/package.json b/package.json index abc498b33..743bdd18c 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,6 @@ "filewatcher-webpack-plugin": "^1.2.0", "flow-bin": "^0.69.0", "flow-typed": "^2.3.0", - "fs-path": "^0.0.24", "husky": "^0.14.3", "i18n-extract": "^0.5.1", "json-loader": "^0.5.4", diff --git a/yarn.lock b/yarn.lock index 99f767bb8..3b0cfe49c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -451,7 +451,7 @@ async-foreach@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/async-foreach/-/async-foreach-0.1.3.tgz#36121f845c0578172de419a97dbeb1d16ec34542" -async@^0.9.0, async@~0.9.0: +async@^0.9.0: version "0.9.2" resolved "https://registry.yarnpkg.com/async/-/async-0.9.2.tgz#aea74d5e61c1f899613bf64bda66d4c78f2fd17d" @@ -4233,12 +4233,6 @@ fs-minipass@^1.2.5: dependencies: minipass "^2.2.1" -fs-path@^0.0.24: - version "0.0.24" - resolved "https://registry.yarnpkg.com/fs-path/-/fs-path-0.0.24.tgz#21a4b8d7dce5bae6d208261955dbc2bcf1e75c06" - dependencies: - async "~0.9.0" - fs-write-stream-atomic@^1.0.8: version "1.0.10" resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9" -- 2.43.4 From 523fdf694b127e81f96af7371b1539934e7dddf2 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 7 Nov 2018 23:14:35 -0500 Subject: [PATCH 12/15] fix license type on edit --- src/renderer/redux/actions/publish.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/renderer/redux/actions/publish.js b/src/renderer/redux/actions/publish.js index e2aa89f1e..cf2ee9a0b 100644 --- a/src/renderer/redux/actions/publish.js +++ b/src/renderer/redux/actions/publish.js @@ -22,7 +22,7 @@ import { selectosNotificationsEnabled } from 'redux/selectors/settings'; import { doNavigate } from 'redux/actions/navigation'; import fs from 'fs'; import path from 'path'; -import { CC_LICENSES, COPYRIGHT, OTHER } from 'constants/licenses'; +import { CC_LICENSES, COPYRIGHT, OTHER, NONE, PUBLIC_DOMAIN } from 'constants/licenses'; type Action = UpdatePublishFormAction | { type: ACTIONS.CLEAR_PUBLISH }; @@ -179,8 +179,11 @@ export const doPrepareEdit = (claim: any, uri: string) => (dispatch: Dispatch value === license)) { - if (!licenseUrl) { + if (!license || license === NONE || license === PUBLIC_DOMAIN) { + publishData.licenseType = license; + } else if (license && !licenseUrl && license !== NONE) { publishData.licenseType = COPYRIGHT; } else { publishData.licenseType = OTHER; -- 2.43.4 From 7071937e35a21723b5135355832a103dc92d8c13 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 8 Nov 2018 11:23:17 -0500 Subject: [PATCH 13/15] bump lbry-redux --- package.json | 2 +- yarn.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 76057d5d2..e1194f63e 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "formik": "^0.10.4", "hast-util-sanitize": "^1.1.2", "keytar": "^4.2.1", - "lbry-redux": "lbryio/lbry-redux#6f1e3b054fda5a818eacf778393022f96082c387", + "lbry-redux": "lbryio/lbry-redux#baf69483050e2845fdc2dbaeb26ef6bf0f8f5704", "lbryinc": "lbryio/lbryinc#7a458ea13ceceffa0191e73139f94e5c953f22b1", "localforage": "^1.7.1", "mammoth": "^1.4.6", diff --git a/yarn.lock b/yarn.lock index 273e8a3d8..d6d6342bd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5670,9 +5670,9 @@ lbry-redux@lbryio/lbry-redux#2375860d6269d0369418879c2531b1d48c4e47f2: proxy-polyfill "0.1.6" reselect "^3.0.0" -lbry-redux@lbryio/lbry-redux#6f1e3b054fda5a818eacf778393022f96082c387: +lbry-redux@lbryio/lbry-redux#baf69483050e2845fdc2dbaeb26ef6bf0f8f5704: version "0.0.1" - resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/6f1e3b054fda5a818eacf778393022f96082c387" + resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/baf69483050e2845fdc2dbaeb26ef6bf0f8f5704" dependencies: proxy-polyfill "0.1.6" reselect "^3.0.0" -- 2.43.4 From b5ad608d88c053a36bbedbc0bd81ca91e79a4a6a Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 8 Nov 2018 12:13:36 -0500 Subject: [PATCH 14/15] add RefreshTransactionList button --- .../component/transactionListRecent/view.jsx | 14 ++--- .../transactionRefreshButton/index.js | 16 ++++++ .../transactionRefreshButton/view.jsx | 51 +++++++++++++++++++ src/renderer/page/transactionHistory/view.jsx | 13 ++--- 4 files changed, 74 insertions(+), 20 deletions(-) create mode 100644 src/renderer/component/transactionRefreshButton/index.js create mode 100644 src/renderer/component/transactionRefreshButton/view.jsx diff --git a/src/renderer/component/transactionListRecent/view.jsx b/src/renderer/component/transactionListRecent/view.jsx index 3462a4d7f..41c60dd64 100644 --- a/src/renderer/component/transactionListRecent/view.jsx +++ b/src/renderer/component/transactionListRecent/view.jsx @@ -1,10 +1,11 @@ // @flow +import type { Transaction } from 'component/transactionList/view'; import React, { Fragment } from 'react'; import BusyIndicator from 'component/common/busy-indicator'; import Button from 'component/button'; import TransactionList from 'component/transactionList'; import * as icons from 'constants/icons'; -import type { Transaction } from 'component/transactionList/view'; +import RefreshTransactionButton from 'component/transactionRefreshButton'; type Props = { fetchTransactions: () => void, @@ -23,19 +24,12 @@ class TransactionListRecent extends React.PureComponent { } render() { - const { fetchingTransactions, hasTransactions, transactions, fetchTransactions } = this.props; + const { fetchingTransactions, hasTransactions, transactions } = this.props; return (
{__('Recent Transactions')} -
-
+
{__('To view all of your transactions, navigate to the')}{' '} diff --git a/src/renderer/component/transactionRefreshButton/index.js b/src/renderer/component/transactionRefreshButton/index.js new file mode 100644 index 000000000..5f2ecd686 --- /dev/null +++ b/src/renderer/component/transactionRefreshButton/index.js @@ -0,0 +1,16 @@ +import { connect } from 'react-redux'; +import { doFetchTransactions, selectIsFetchingTransactions } from 'lbry-redux'; +import RefreshTransactionButton from './view'; + +const select = state => ({ + fetchingTransactions: selectIsFetchingTransactions(state), +}); + +const perform = dispatch => ({ + fetchTransactions: () => dispatch(doFetchTransactions()), +}); + +export default connect( + select, + perform +)(RefreshTransactionButton); diff --git a/src/renderer/component/transactionRefreshButton/view.jsx b/src/renderer/component/transactionRefreshButton/view.jsx new file mode 100644 index 000000000..bbaf730fe --- /dev/null +++ b/src/renderer/component/transactionRefreshButton/view.jsx @@ -0,0 +1,51 @@ +// @flow +import React, { PureComponent } from 'react'; +import Button from 'component/button'; + +type Props = { + fetchTransactions: () => void, + fetchingTransactions: boolean, +}; + +type State = { + label: string, + disabled: boolean, +}; + +class TransactionListRecent extends PureComponent { + constructor() { + super(); + + this.state = { label: __('Refresh'), disabled: false }; + + (this: any).handleClick = this.handleClick.bind(this); + } + + handleClick() { + const { fetchTransactions } = this.props; + + // The fetchTransactions call will be super fast most of the time. + // Instead of showing a loading spinner for 100ms, change the label and show as "Refreshed!" + fetchTransactions(); + this.setState({ label: __('Refreshed!'), disabled: true }); + + setTimeout(() => { + this.setState({ label: __('Refresh'), disabled: false }); + }, 2000); + } + + render() { + const { fetchingTransactions } = this.props; + const { label, disabled } = this.state; + return ( +
+
{fetchingTransactions && !transactions.length ? (
-- 2.43.4 From dd829b11e0d1990584ed5bcef0a80ae23e7da7ce Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 8 Nov 2018 15:55:00 -0500 Subject: [PATCH 15/15] update lbry-redux --- package.json | 2 +- yarn.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e1194f63e..a6073a90f 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "formik": "^0.10.4", "hast-util-sanitize": "^1.1.2", "keytar": "^4.2.1", - "lbry-redux": "lbryio/lbry-redux#baf69483050e2845fdc2dbaeb26ef6bf0f8f5704", + "lbry-redux": "lbryio/lbry-redux#6139cede26a5c17a8ecfc8a5c0445568ee686255", "lbryinc": "lbryio/lbryinc#7a458ea13ceceffa0191e73139f94e5c953f22b1", "localforage": "^1.7.1", "mammoth": "^1.4.6", diff --git a/yarn.lock b/yarn.lock index d6d6342bd..1898f5f38 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5670,9 +5670,9 @@ lbry-redux@lbryio/lbry-redux#2375860d6269d0369418879c2531b1d48c4e47f2: proxy-polyfill "0.1.6" reselect "^3.0.0" -lbry-redux@lbryio/lbry-redux#baf69483050e2845fdc2dbaeb26ef6bf0f8f5704: +lbry-redux@lbryio/lbry-redux#6139cede26a5c17a8ecfc8a5c0445568ee686255: version "0.0.1" - resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/baf69483050e2845fdc2dbaeb26ef6bf0f8f5704" + resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/6139cede26a5c17a8ecfc8a5c0445568ee686255" dependencies: proxy-polyfill "0.1.6" reselect "^3.0.0" -- 2.43.4