diff --git a/.eslintrc.json b/.eslintrc.json index 6a992f8bf..a8f285504 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -43,6 +43,7 @@ "class-methods-use-this": 0, "jsx-a11y/interactive-supports-focus": 0, "jsx-a11y/click-events-have-key-events": 0, - "consistent-return": 0 + "consistent-return": 0, + "flowtype/space-after-type-colon": [ 2, "always", { "allowLineBreak": true } ] } } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 639ae499e..3ad36a747 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -119,7 +119,7 @@ You can also use the following command: `$ yarn format` -for applying formatting rules to the entire project's code. For formatting a specific file or +for applying formatting rules to all project's code sources. For formatting a specific file or directory, use: `$ yarn prettier 'glob/pattern'` diff --git a/README.md b/README.md index 3615803c0..76ffec921 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # LBRY App [![MIT licensed](https://img.shields.io/dub/l/vibe-d.svg?style=flat)](https://github.com/lbryio/lbry-desktop/blob/master/LICENSE) -[![GitHub release](https://img.shields.io/github/release/lbryio/lbry-desktop.svg)](https://GitHub.com/lbryio/lbry-desktop/releases/) [![Build Status](https://travis-ci.org/lbryio/lbry-desktop.svg?branch=master)](https://travis-ci.org/lbryio/lbry-desktop) [![Dependencies](https://david-dm.org/lbryio/lbry-desktop/status.svg)](https://david-dm.org/lbryio/lbry-desktop) +[![Codacy Badge](https://api.codacy.com/project/badge/Grade/78b627d4f5524792adc48719835e1523)](https://www.codacy.com/app/LBRY/lbry-desktop?utm_source=github.com&utm_medium=referral&utm_content=lbryio/lbry-desktop&utm_campaign=Badge_Grade) [![chat on Discord](https://img.shields.io/discord/362322208485277697.svg?logo=discord)](https://chat.lbry.io) [![forthebadge](https://forthebadge.com/images/badges/60-percent-of-the-time-works-every-time.svg)](https://forthebadge.com) @@ -64,10 +64,9 @@ distributable packages. If the app isn't building, or `yarn xxx` commands aren't working you may need to just reset your `node_modules`. To do so you can run: `rm -r node_modules && yarn` or `del /s /q node_modules && yarn` on Windows. -## Contributing -We :heart: contributions from everyone and contributions to this project are encouraged, and compensated. We welcome [bug reports](https://github.com/lbryio/lbry-desktop/issues/), [bug fixes](https://github.com/lbryio/lbry-desktop/pulls) and feedback is always appreciated. For more details, see [CONTRIBUTING.md](CONTRIBUTING.md). +## Contributing -## [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/lbryio/lbry-desktop/issues) [![GitHub contributors](https://img.shields.io/github/contributors/lbryio/lbry-desktop.svg)](https://GitHub.com/lbryio/lbry-desktop/graphs/contributors/) +Contributions to this project are welcome, encouraged, and compensated. For more details, see [CONTRIBUTING.md](CONTRIBUTING.md). ## License diff --git a/package.json b/package.json index 0787f6304..10da3eb23 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#f193d38c61ea061679ebc7b4ca139a0e9c95ef8a", + "lbry-redux": "lbryio/lbry-redux#dd26422a86a37b5a492dc0702269ad6fc04ecdd7", "lbryinc": "lbryio/lbryinc#7a458ea13ceceffa0191e73139f94e5c953f22b1", "localforage": "^1.7.1", "mammoth": "^1.4.6", diff --git a/src/renderer/component/button/index.js b/src/renderer/component/button/index.js index c3bb8586d..478015d09 100644 --- a/src/renderer/component/button/index.js +++ b/src/renderer/component/button/index.js @@ -6,7 +6,4 @@ const perform = dispatch => ({ doNavigate: (path, params) => dispatch(doNavigate(path, params)), }); -export default connect( - null, - perform -)(Button); +export default connect(null, perform)(Button); diff --git a/src/renderer/component/channelTile/index.js b/src/renderer/component/channelTile/index.js index 004816016..c272fc2bf 100644 --- a/src/renderer/component/channelTile/index.js +++ b/src/renderer/component/channelTile/index.js @@ -15,7 +15,4 @@ const perform = dispatch => ({ resolveUri: uri => dispatch(doResolveUri(uri)), }); -export default connect( - select, - perform -)(ChannelTile); +export default connect(select, perform)(ChannelTile); diff --git a/src/renderer/component/common/credit-amount.jsx b/src/renderer/component/common/credit-amount.jsx index 0f8d89338..79c4adc54 100644 --- a/src/renderer/component/common/credit-amount.jsx +++ b/src/renderer/component/common/credit-amount.jsx @@ -82,7 +82,7 @@ class CreditAmount extends React.PureComponent { // TODO: remove inheritStyle prop // It just complicates things 'credit-amount--inherit': inheritStyle, - badge, + badge: badge, 'badge--cost': badge && !isFree, 'badge--free': badge && isFree, })} diff --git a/src/renderer/component/dateTime/index.js b/src/renderer/component/dateTime/index.js index 3e1ad14a1..adae8f658 100644 --- a/src/renderer/component/dateTime/index.js +++ b/src/renderer/component/dateTime/index.js @@ -10,7 +10,4 @@ const perform = dispatch => ({ fetchBlock: height => dispatch(doFetchBlock(height)), }); -export default connect( - select, - perform -)(DateTime); +export default connect(select, perform)(DateTime); diff --git a/src/renderer/component/externalLink/index.js b/src/renderer/component/externalLink/index.js index 81ad973d8..2855016f2 100644 --- a/src/renderer/component/externalLink/index.js +++ b/src/renderer/component/externalLink/index.js @@ -9,7 +9,4 @@ const perform = dispatch => ({ openModal: (modal, props) => dispatch(doNotify(modal, props)), }); -export default connect( - select, - perform -)(ExternalLink); +export default connect(select, perform)(ExternalLink); diff --git a/src/renderer/component/fileActions/index.js b/src/renderer/component/fileActions/index.js index 0a52424a8..1ee1cffe9 100644 --- a/src/renderer/component/fileActions/index.js +++ b/src/renderer/component/fileActions/index.js @@ -18,7 +18,4 @@ const perform = dispatch => ({ openModal: (modal, props) => dispatch(doNotify(modal, props)), }); -export default connect( - select, - perform -)(FileActions); +export default connect(select, perform)(FileActions); diff --git a/src/renderer/component/fileDetails/index.js b/src/renderer/component/fileDetails/index.js index fb92ce86f..18541f6da 100644 --- a/src/renderer/component/fileDetails/index.js +++ b/src/renderer/component/fileDetails/index.js @@ -19,7 +19,4 @@ const perform = dispatch => ({ openFolder: path => dispatch(doOpenFileInFolder(path)), }); -export default connect( - select, - perform -)(FileDetails); +export default connect(select, perform)(FileDetails); diff --git a/src/renderer/component/filePrice/index.js b/src/renderer/component/filePrice/index.js index 688644316..8351dc6f1 100644 --- a/src/renderer/component/filePrice/index.js +++ b/src/renderer/component/filePrice/index.js @@ -18,7 +18,4 @@ const perform = dispatch => ({ // cancelFetchCostInfo: (uri) => dispatch(doCancelFetchCostInfoForUri(uri)) }); -export default connect( - select, - perform -)(FilePrice); +export default connect(select, perform)(FilePrice); diff --git a/src/renderer/component/nsfwOverlay/index.js b/src/renderer/component/nsfwOverlay/index.js index 7a2eec7c5..515a0ecd6 100644 --- a/src/renderer/component/nsfwOverlay/index.js +++ b/src/renderer/component/nsfwOverlay/index.js @@ -6,7 +6,4 @@ const perform = dispatch => ({ navigateSettings: () => dispatch(doNavigate('/settings')), }); -export default connect( - null, - perform -)(NsfwOverlay); +export default connect(null, perform)(NsfwOverlay); diff --git a/src/renderer/component/router/index.js b/src/renderer/component/router/index.js index 1d795a0c3..20933d960 100644 --- a/src/renderer/component/router/index.js +++ b/src/renderer/component/router/index.js @@ -7,7 +7,4 @@ const select = state => ({ currentPage: selectCurrentPage(state), }); -export default connect( - select, - { doNotify } -)(Router); +export default connect(select, { doNotify })(Router); diff --git a/src/renderer/component/snackBar/index.js b/src/renderer/component/snackBar/index.js index 4899c31e9..55ea7e0a1 100644 --- a/src/renderer/component/snackBar/index.js +++ b/src/renderer/component/snackBar/index.js @@ -10,7 +10,4 @@ const select = state => ({ snack: selectSnack(state), }); -export default connect( - select, - perform -)(SnackBar); +export default connect(select, perform)(SnackBar); diff --git a/src/renderer/component/spinner/index.js b/src/renderer/component/spinner/index.js index f87e67748..6589e05da 100644 --- a/src/renderer/component/spinner/index.js +++ b/src/renderer/component/spinner/index.js @@ -6,7 +6,4 @@ const mapStateToProps = state => ({ theme: selectTheme(state), }); -export default connect( - mapStateToProps, - null -)(Spinner); +export default connect(mapStateToProps, null)(Spinner); diff --git a/src/renderer/component/transactionList/view.jsx b/src/renderer/component/transactionList/view.jsx index 4aaf9ae27..c5f043d89 100644 --- a/src/renderer/component/transactionList/view.jsx +++ b/src/renderer/component/transactionList/view.jsx @@ -66,7 +66,10 @@ class TransactionList extends React.PureComponent { render() { const { emptyMessage, rewards, transactions, slim, filterSetting } = this.props; - const transactionList = transactions.filter(this.filterTransaction); + + // The shorter "recent transactions" list shouldn't be filtered + const transactionList = slim ? transactions : transactions.filter(this.filterTransaction); + // Flow offers little support for Object.values() typing. // https://github.com/facebook/flow/issues/2221 // $FlowFixMe diff --git a/src/renderer/component/transactionListRecent/index.js b/src/renderer/component/transactionListRecent/index.js index f4890679f..3a59bc82f 100644 --- a/src/renderer/component/transactionListRecent/index.js +++ b/src/renderer/component/transactionListRecent/index.js @@ -17,7 +17,4 @@ const perform = dispatch => ({ fetchTransactions: () => dispatch(doFetchTransactions()), }); -export default connect( - select, - perform -)(TransactionListRecent); +export default connect(select, perform)(TransactionListRecent); diff --git a/src/renderer/component/uriIndicator/index.js b/src/renderer/component/uriIndicator/index.js index d7bf10ec6..8524965d5 100644 --- a/src/renderer/component/uriIndicator/index.js +++ b/src/renderer/component/uriIndicator/index.js @@ -17,7 +17,4 @@ const perform = dispatch => ({ resolveUri: uri => dispatch(doResolveUri(uri)), }); -export default connect( - select, - perform -)(UriIndicator); +export default connect(select, perform)(UriIndicator); diff --git a/src/renderer/component/walletAddress/index.js b/src/renderer/component/walletAddress/index.js index 603cf704e..8955c6651 100644 --- a/src/renderer/component/walletAddress/index.js +++ b/src/renderer/component/walletAddress/index.js @@ -17,7 +17,4 @@ const perform = dispatch => ({ getNewAddress: () => dispatch(doGetNewAddress()), }); -export default connect( - select, - perform -)(WalletAddress); +export default connect(select, perform)(WalletAddress); diff --git a/src/renderer/component/walletBalance/index.js b/src/renderer/component/walletBalance/index.js index 6e136f1bd..9f69e655b 100644 --- a/src/renderer/component/walletBalance/index.js +++ b/src/renderer/component/walletBalance/index.js @@ -6,7 +6,4 @@ const select = state => ({ balance: selectBalance(state), }); -export default connect( - select, - null -)(WalletBalance); +export default connect(select, null)(WalletBalance); diff --git a/src/renderer/component/walletSend/index.js b/src/renderer/component/walletSend/index.js index e009b175d..a734be4c4 100644 --- a/src/renderer/component/walletSend/index.js +++ b/src/renderer/component/walletSend/index.js @@ -10,7 +10,4 @@ const select = state => ({ balance: selectBalance(state), }); -export default connect( - select, - perform -)(WalletSend); +export default connect(select, perform)(WalletSend); diff --git a/src/renderer/modal/modalAffirmPurchase/index.js b/src/renderer/modal/modalAffirmPurchase/index.js index 1bd9f854e..623ae7b88 100644 --- a/src/renderer/modal/modalAffirmPurchase/index.js +++ b/src/renderer/modal/modalAffirmPurchase/index.js @@ -16,7 +16,4 @@ const perform = dispatch => ({ loadVideo: uri => dispatch(doLoadVideo(uri)), }); -export default connect( - select, - perform -)(ModalAffirmPurchase); +export default connect(select, perform)(ModalAffirmPurchase); diff --git a/src/renderer/modal/modalConfirmTransaction/index.js b/src/renderer/modal/modalConfirmTransaction/index.js index b29b86285..fa9f1a520 100644 --- a/src/renderer/modal/modalConfirmTransaction/index.js +++ b/src/renderer/modal/modalConfirmTransaction/index.js @@ -7,7 +7,4 @@ const perform = dispatch => ({ sendToAddress: (address, amount) => dispatch(doSendDraftTransaction(address, amount)), }); -export default connect( - null, - perform -)(ModalConfirmTransaction); +export default connect(null, perform)(ModalConfirmTransaction); diff --git a/src/renderer/modal/modalError/index.js b/src/renderer/modal/modalError/index.js index b37d57a88..e8c07bc17 100644 --- a/src/renderer/modal/modalError/index.js +++ b/src/renderer/modal/modalError/index.js @@ -6,7 +6,4 @@ const perform = dispatch => ({ closeModal: () => dispatch(doHideNotification()), }); -export default connect( - null, - perform -)(ModalError); +export default connect(null, perform)(ModalError); diff --git a/src/renderer/modal/modalFileTimeout/index.js b/src/renderer/modal/modalFileTimeout/index.js index cff75810a..04fdec82b 100644 --- a/src/renderer/modal/modalFileTimeout/index.js +++ b/src/renderer/modal/modalFileTimeout/index.js @@ -10,7 +10,4 @@ const perform = dispatch => ({ closeModal: () => dispatch(doHideNotification()), }); -export default connect( - select, - perform -)(ModalFileTimeout); +export default connect(select, perform)(ModalFileTimeout); diff --git a/src/renderer/modal/modalFirstSubscription/index.js b/src/renderer/modal/modalFirstSubscription/index.js index f3fd08438..5831c1094 100644 --- a/src/renderer/modal/modalFirstSubscription/index.js +++ b/src/renderer/modal/modalFirstSubscription/index.js @@ -8,7 +8,4 @@ const perform = dispatch => () => ({ navigate: path => dispatch(doNavigate(path)), }); -export default connect( - null, - perform -)(ModalFirstSubscription); +export default connect(null, perform)(ModalFirstSubscription); diff --git a/src/renderer/modal/modalIncompatibleDaemon/index.js b/src/renderer/modal/modalIncompatibleDaemon/index.js index a676fdd88..8feed2ca7 100644 --- a/src/renderer/modal/modalIncompatibleDaemon/index.js +++ b/src/renderer/modal/modalIncompatibleDaemon/index.js @@ -7,7 +7,4 @@ const perform = dispatch => ({ quitAnyDaemon: () => dispatch(doQuitAnyDaemon()), }); -export default connect( - null, - perform -)(ModalIncompatibleDaemon); +export default connect(null, perform)(ModalIncompatibleDaemon); diff --git a/src/renderer/modal/modalOpenExternalLink/index.js b/src/renderer/modal/modalOpenExternalLink/index.js index 4ff2f30cb..2703b100e 100644 --- a/src/renderer/modal/modalOpenExternalLink/index.js +++ b/src/renderer/modal/modalOpenExternalLink/index.js @@ -6,7 +6,4 @@ const perform = dispatch => ({ closeModal: () => dispatch(doHideNotification()), }); -export default connect( - null, - perform -)(ModalOpenExternalLink); +export default connect(null, perform)(ModalOpenExternalLink); diff --git a/src/renderer/modal/modalRemoveFile/index.js b/src/renderer/modal/modalRemoveFile/index.js index 363772dcb..b6f7780fe 100644 --- a/src/renderer/modal/modalRemoveFile/index.js +++ b/src/renderer/modal/modalRemoveFile/index.js @@ -21,7 +21,4 @@ const perform = dispatch => ({ }, }); -export default connect( - select, - perform -)(ModalRemoveFile); +export default connect(select, perform)(ModalRemoveFile); diff --git a/src/renderer/modal/modalRevokeClaim/index.js b/src/renderer/modal/modalRevokeClaim/index.js index b99715697..a79039529 100644 --- a/src/renderer/modal/modalRevokeClaim/index.js +++ b/src/renderer/modal/modalRevokeClaim/index.js @@ -11,7 +11,4 @@ const perform = dispatch => ({ abandonClaim: (txid, nout) => dispatch(doAbandonClaim(txid, nout)), }); -export default connect( - select, - perform -)(ModalRevokeClaim); +export default connect(select, perform)(ModalRevokeClaim); diff --git a/src/renderer/modal/modalRewardApprovalRequired/index.js b/src/renderer/modal/modalRewardApprovalRequired/index.js index af651ca2d..88efa5355 100644 --- a/src/renderer/modal/modalRewardApprovalRequired/index.js +++ b/src/renderer/modal/modalRewardApprovalRequired/index.js @@ -11,7 +11,4 @@ const perform = dispatch => ({ closeModal: () => dispatch(doHideNotification()), }); -export default connect( - null, - perform -)(ModalRewardApprovalRequired); +export default connect(null, perform)(ModalRewardApprovalRequired); diff --git a/src/renderer/modal/modalSendTip/index.js b/src/renderer/modal/modalSendTip/index.js index b830c384e..f6c67325d 100644 --- a/src/renderer/modal/modalSendTip/index.js +++ b/src/renderer/modal/modalSendTip/index.js @@ -6,7 +6,4 @@ const perform = dispatch => ({ closeModal: () => dispatch(doHideNotification()), }); -export default connect( - null, - perform -)(ModalSendTip); +export default connect(null, perform)(ModalSendTip); diff --git a/src/renderer/modal/modalWelcome/index.js b/src/renderer/modal/modalWelcome/index.js index 2e030ef9e..201af1904 100644 --- a/src/renderer/modal/modalWelcome/index.js +++ b/src/renderer/modal/modalWelcome/index.js @@ -11,7 +11,4 @@ const perform = dispatch => () => ({ }, }); -export default connect( - null, - perform -)(ModalWelcome); +export default connect(null, perform)(ModalWelcome); diff --git a/src/renderer/page/fileListPublished/index.js b/src/renderer/page/fileListPublished/index.js index d3b4e90fd..1826fb78d 100644 --- a/src/renderer/page/fileListPublished/index.js +++ b/src/renderer/page/fileListPublished/index.js @@ -1,6 +1,9 @@ import { connect } from 'react-redux'; -import { selectPendingPublishes } from 'redux/selectors/publish'; -import { selectIsFetchingClaimListMine, selectFileListPublishedSort, selectMyClaimsWithoutChannels } from 'lbry-redux'; +import { + selectIsFetchingClaimListMine, + selectFileListPublishedSort, + selectMyClaimsWithoutChannels, +} from 'lbry-redux'; import { doNavigate } from 'redux/actions/navigation'; import { doCheckPendingPublishes } from 'redux/actions/publish'; import FileListPublished from './view'; diff --git a/src/renderer/page/fileListPublished/view.jsx b/src/renderer/page/fileListPublished/view.jsx index 338da3b60..478a79999 100644 --- a/src/renderer/page/fileListPublished/view.jsx +++ b/src/renderer/page/fileListPublished/view.jsx @@ -22,7 +22,6 @@ class FileListPublished extends React.PureComponent { render() { const { fetching, claims, navigate, sortBy } = this.props; - return ( {claims && claims.length ? ( diff --git a/src/renderer/page/report/index.js b/src/renderer/page/report/index.js index 0fed73d36..a43d54529 100644 --- a/src/renderer/page/report/index.js +++ b/src/renderer/page/report/index.js @@ -1,3 +1,4 @@ +import { connect } from 'react-redux'; import ReportPage from './view'; -export default ReportPage; +export default connect(null, null)(ReportPage); diff --git a/src/renderer/page/show/index.js b/src/renderer/page/show/index.js index 9f67c04b1..122c6774a 100644 --- a/src/renderer/page/show/index.js +++ b/src/renderer/page/show/index.js @@ -17,7 +17,4 @@ const perform = dispatch => ({ resolveUri: uri => dispatch(doResolveUri(uri)), }); -export default connect( - select, - perform -)(ShowPage); +export default connect(select, perform)(ShowPage); diff --git a/src/renderer/page/transactionHistory/index.js b/src/renderer/page/transactionHistory/index.js index 33af4fc09..b31414474 100644 --- a/src/renderer/page/transactionHistory/index.js +++ b/src/renderer/page/transactionHistory/index.js @@ -15,7 +15,4 @@ const perform = dispatch => ({ fetchTransactions: () => dispatch(doFetchTransactions()), }); -export default connect( - select, - perform -)(TransactionHistoryPage); +export default connect(select, perform)(TransactionHistoryPage); diff --git a/src/renderer/page/userHistory/index.js b/src/renderer/page/userHistory/index.js index d55e88a48..650e45760 100644 --- a/src/renderer/page/userHistory/index.js +++ b/src/renderer/page/userHistory/index.js @@ -1,3 +1,4 @@ +import { connect } from 'react-redux'; import UserHistoryPage from './view'; -export default UserHistoryPage; +export default connect(null, null)(UserHistoryPage); diff --git a/src/renderer/redux/actions/publish.js b/src/renderer/redux/actions/publish.js index af0e9709a..4894e6200 100644 --- a/src/renderer/redux/actions/publish.js +++ b/src/renderer/redux/actions/publish.js @@ -16,6 +16,7 @@ import { batchActions, creditsToString, selectPendingById, + selectMyClaimsWithoutChannels, } from 'lbry-redux'; import { selectosNotificationsEnabled } from 'redux/selectors/settings'; import { doNavigate } from 'redux/actions/navigation'; @@ -199,6 +200,7 @@ export const doPublish = (params: PublishParams) => ( ) => { const state = getState(); const myChannels = selectMyChannelClaims(state); + const myClaims = selectMyClaimsWithoutChannels(state); const { name, @@ -223,7 +225,7 @@ export const doPublish = (params: PublishParams) => ( const channelId = namedChannelClaim ? namedChannelClaim.claim_id : ''; const fee = contentIsFree || !price.amount ? undefined : { ...price }; - const metadata = { + const metadata: Metadata = { title, nsfw, license, @@ -262,11 +264,32 @@ export const doPublish = (params: PublishParams) => ( dispatch({ type: ACTIONS.PUBLISH_START }); - const success = () => { - dispatch({ + const success = pendingClaim => { + const actions = []; + + actions.push({ type: ACTIONS.PUBLISH_SUCCESS, }); - dispatch(doNotify({ id: MODALS.PUBLISH }, { uri })); + + actions.push(doNotify({ id: MODALS.PUBLISH }, { uri })); + + // We have to fake a temp claim until the new pending one is returned by claim_list_mine + // We can't rely on claim_list_mine because there might be some delay before the new claims are returned + // Doing this allows us to show the pending claim immediately, it will get overwritten by the real one + const isMatch = claim => claim.claim_id === pendingClaim.claim_id; + const isEdit = myClaims.some(isMatch); + const myNewClaims = isEdit + ? myClaims.map(claim => (isMatch(claim) ? pendingClaim.output : claim)) + : myClaims.concat(pendingClaim.output); + + actions.push({ + type: ACTIONS.FETCH_CLAIM_LIST_MINE_COMPLETED, + data: { + claims: myNewClaims, + }, + }); + + dispatch(batchActions(...actions)); }; const failure = error => { @@ -281,7 +304,8 @@ export const doPublish = (params: PublishParams) => ( export const doCheckPendingPublishes = () => (dispatch: Dispatch, getState: GetState) => { const state = getState(); const pendingById = selectPendingById(state); - if (!Object.keys(pendingById)) { + + if (!Object.keys(pendingById).length) { return; } @@ -289,8 +313,9 @@ 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 that it wasn't pending previously + // If it's confirmed, check if it was pending previously if (claim.confirmations > 0 && pendingById[claim.claim_id]) { delete pendingById[claim.claim_id]; @@ -326,7 +351,6 @@ export const doCheckPendingPublishes = () => (dispatch: Dispatch, getSta }); }; - checkFileList(); publishCheckInterval = setInterval(() => { checkFileList(); }, 30000); diff --git a/src/renderer/redux/reducers/subscriptions.js b/src/renderer/redux/reducers/subscriptions.js index 5f007b7c0..ccde02056 100644 --- a/src/renderer/redux/reducers/subscriptions.js +++ b/src/renderer/redux/reducers/subscriptions.js @@ -41,13 +41,18 @@ export default handleActions( action: DoChannelUnsubscribe ): SubscriptionState => { const subscriptionToRemove: Subscription = action.data; - const newSubscriptions = state.subscriptions .slice() .filter(subscription => subscription.channelName !== subscriptionToRemove.channelName); + // Check if we need to remove it from the 'unread' state + const { unread } = state.unread; + if (unread[subscriptionToRemove.uri]) { + delete unread[subscriptionToRemove.uri]; + } return { ...state, + ...unread, subscriptions: newSubscriptions, }; }, diff --git a/src/renderer/scss/all.scss b/src/renderer/scss/all.scss index b2d980ef2..8b421609c 100644 --- a/src/renderer/scss/all.scss +++ b/src/renderer/scss/all.scss @@ -5,5 +5,5 @@ 'component/snack-bar', 'component/content', 'component/pagination', 'component/markdown-preview', 'component/markdown-editor', 'component/scrollbar', 'component/spinner', 'component/nav', 'component/file-list', 'component/file-render', 'component/search', 'component/toggle', - 'component/search', 'component/dat-gui', 'component/item-list', 'component/time', 'component/icon', + 'component/dat-gui', 'component/item-list', 'component/time', 'component/icon', 'component/placeholder', 'component/badge', 'themes/dark'; diff --git a/src/renderer/scss/component/_badge.scss b/src/renderer/scss/component/_badge.scss index e6aaf4eb9..8f3cec21b 100644 --- a/src/renderer/scss/component/_badge.scss +++ b/src/renderer/scss/component/_badge.scss @@ -6,8 +6,8 @@ } .badge--alert { - background-color: #e45454; - color: white; + background-color: $lbry-red-3; + color: $lbry-white; } .badge--free { diff --git a/src/renderer/scss/component/_button.scss b/src/renderer/scss/component/_button.scss index 182ec462a..a12d1a77e 100644 --- a/src/renderer/scss/component/_button.scss +++ b/src/renderer/scss/component/_button.scss @@ -74,8 +74,7 @@ } } - &.btn--disabled:disabled { - // wtf? + &:disabled { cursor: default; &.btn--primary { diff --git a/src/renderer/scss/themes/_dark.scss b/src/renderer/scss/themes/_dark.scss index 41b62c0b0..6248f3e9f 100644 --- a/src/renderer/scss/themes/_dark.scss +++ b/src/renderer/scss/themes/_dark.scss @@ -82,9 +82,18 @@ html[data-theme='dark'] { background-color: rgba($lbry-red-1, 0.1); } - .btn.btn--alt:not(:disabled) { - background-color: rgba($lbry-white, 0.1); - color: $lbry-gray-1; + // + // BUTTON + // + .btn { + &.btn--alt:not(:disabled) { + background-color: rgba($lbry-white, 0.1); + color: $lbry-gray-1; + } + + &.btn--primary:disabled { + background-color: rgba($lbry-teal-5, 0.15); + } } .search__top { @@ -121,10 +130,6 @@ html[data-theme='dark'] { background-color: rgba($lbry-black, 0.7); } - .btn { - color: $lbry-gray-3; - } - .modal { background-color: rgba($lbry-black, 0.9); border: 1px solid rgba($lbry-gray-1, 0.1); diff --git a/src/renderer/types/claim.js b/src/renderer/types/claim.js index dcc8fef1e..a7b86a39e 100644 --- a/src/renderer/types/claim.js +++ b/src/renderer/types/claim.js @@ -14,6 +14,18 @@ export type Metadata = { title: string, thumbnail: ?string, description: ?string, + fee?: + | { + amount: number, // should be a string https://github.com/lbryio/lbry/issues/1576 + currency: string, + address: string, + version: string, + } + | { + // We don't include a version or address in the metadata field when publishing + amount: number, + currency: string, + }, }; // Actual claim type has more values than this diff --git a/yarn.lock b/yarn.lock index 43fed3243..df771ac20 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5663,16 +5663,16 @@ lazy-val@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/lazy-val/-/lazy-val-1.0.3.tgz#bb97b200ef00801d94c317e29dc6ed39e31c5edc" -lbry-redux@lbryio/lbry-redux#2375860d6269d0369418879c2531b1d48c4e47f2: +lbry-redux@lbryio/lbry-redux#0e13dd1972e3b40821fee2f9f06e1a0631913aa9: version "0.0.1" - resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/2375860d6269d0369418879c2531b1d48c4e47f2" + resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/0e13dd1972e3b40821fee2f9f06e1a0631913aa9" dependencies: proxy-polyfill "0.1.6" reselect "^3.0.0" -lbry-redux@lbryio/lbry-redux#f193d38c61ea061679ebc7b4ca139a0e9c95ef8a: +lbry-redux@lbryio/lbry-redux#2375860d6269d0369418879c2531b1d48c4e47f2: version "0.0.1" - resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/f193d38c61ea061679ebc7b4ca139a0e9c95ef8a" + resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/2375860d6269d0369418879c2531b1d48c4e47f2" dependencies: proxy-polyfill "0.1.6" reselect "^3.0.0"