From 2aa80ed796e032210072f60aca0b0668be95992f Mon Sep 17 00:00:00 2001 From: hackrush Date: Wed, 13 Dec 2017 14:55:14 +0530 Subject: [PATCH 01/19] Reworked abandon to not be depenedent on txn list --- src/renderer/redux/actions/app.js | 3 +-- src/renderer/redux/actions/content.js | 11 +++++++---- src/renderer/redux/actions/wallet.js | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/renderer/redux/actions/app.js b/src/renderer/redux/actions/app.js index 46b2e5fa1..bf82fb269 100644 --- a/src/renderer/redux/actions/app.js +++ b/src/renderer/redux/actions/app.js @@ -9,7 +9,7 @@ import { selectRemoteVersion, } from "redux/selectors/app"; import { doFetchDaemonSettings } from "redux/actions/settings"; -import { doBalanceSubscribe, doFetchTransactions } from "redux/actions/wallet"; +import { doBalanceSubscribe } from "redux/actions/wallet"; import { doAuthenticate } from "redux/actions/user"; import { doFetchFileInfosAndPublishedClaims } from "redux/actions/file_info"; import * as modals from "constants/modal_types"; @@ -222,7 +222,6 @@ export function doDaemonReady() { dispatch(doBalanceSubscribe()); dispatch(doFetchFileInfosAndPublishedClaims()); dispatch(doFetchRewardedContent()); - dispatch(doFetchTransactions(false)); if (!selectIsUpgradeSkipped(state)) { dispatch(doCheckUpgradeAvailable()); } diff --git a/src/renderer/redux/actions/content.js b/src/renderer/redux/actions/content.js index cb0b3d766..8d7a92a4e 100644 --- a/src/renderer/redux/actions/content.js +++ b/src/renderer/redux/actions/content.js @@ -4,7 +4,8 @@ import lbry from "lbry"; import lbryio from "lbryio"; import lbryuri from "lbryuri"; import { makeSelectClientSetting } from "redux/selectors/settings"; -import { selectBalance, selectTransactionItems } from "redux/selectors/wallet"; +import { selectMyClaimsRaw } from "redux/selectors/claims"; +import { selectBalance } from "redux/selectors/wallet"; import { makeSelectFileInfoForUri, selectDownloadingByOutpoint, @@ -288,7 +289,9 @@ export function doLoadVideo(uri) { }); dispatch( doAlertError( - `Failed to download ${uri}, please try again. If this problem persists, visit https://lbry.io/faq/support for support.` + `Failed to download ${ + uri + }, please try again. If this problem persists, visit https://lbry.io/faq/support for support.` ) ); }); @@ -503,8 +506,8 @@ export function doPublish(params) { export function doAbandonClaim(txid, nout) { return function(dispatch, getState) { const state = getState(); - const transactionItems = selectTransactionItems(state); - const { claim_id: claimId, claim_name: name } = transactionItems.find( + const myClaims = selectMyClaimsRaw(state); + const { claim_id: claimId, name: name } = myClaims.find( claim => claim.txid == txid && claim.nout == nout ); diff --git a/src/renderer/redux/actions/wallet.js b/src/renderer/redux/actions/wallet.js index 5db24d939..09efea390 100644 --- a/src/renderer/redux/actions/wallet.js +++ b/src/renderer/redux/actions/wallet.js @@ -29,13 +29,13 @@ export function doBalanceSubscribe() { }; } -export function doFetchTransactions(fetch_tip_info = true) { +export function doFetchTransactions() { return function(dispatch, getState) { dispatch({ type: types.FETCH_TRANSACTIONS_STARTED, }); - lbry.transaction_list({ include_tip_info: fetch_tip_info }).then(results => { + lbry.transaction_list({ include_tip_info: true }).then(results => { dispatch({ type: types.FETCH_TRANSACTIONS_COMPLETED, data: { From f2e13506dc12657f7491a0322bd9031ba02a5722 Mon Sep 17 00:00:00 2001 From: Igor Gassmann Date: Wed, 13 Dec 2017 10:32:41 -0300 Subject: [PATCH 02/19] Overwrite cmdtest when installing yarn (https://yarnpkg.com/lang/en/docs/install/#linux-tab) --- build/install_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/install_deps.sh b/build/install_deps.sh index 34a212dfe..2e88c67d9 100755 --- a/build/install_deps.sh +++ b/build/install_deps.sh @@ -99,7 +99,7 @@ if ! cmd_exists yarn; then curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | $SUDO apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | $SUDO tee /etc/apt/sources.list.d/yarn.list $SUDO apt-get update - $SUDO apt-get install yarn + $SUDO apt-get -o Dpkg::Options::="--force-overwrite" install yarn elif $OSX; then brew install yarn else From ca527cc4c0afb1c0426a1387e9d9fb0300a44c88 Mon Sep 17 00:00:00 2001 From: Travis Eden Date: Thu, 14 Dec 2017 16:12:04 -0500 Subject: [PATCH 03/19] Make Discover page channel names into links --- src/renderer/component/fileCard/view.jsx | 10 +++++--- src/renderer/component/link/view.jsx | 26 +++++++++++--------- src/renderer/component/uriIndicator/view.jsx | 3 ++- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/renderer/component/fileCard/view.jsx b/src/renderer/component/fileCard/view.jsx index 00a42eb29..a7ec6a5fa 100644 --- a/src/renderer/component/fileCard/view.jsx +++ b/src/renderer/component/fileCard/view.jsx @@ -94,20 +94,22 @@ class FileCard extends React.PureComponent { {title}
- + {" "} {isRewardContent && }{" "} {fileInfo && } - + + +
- {/* Test for nizuka's design: should we remove description? + + {/* Test for nizuka's design: should we remove description?
{description}
*/} - {obscureNsfw && this.state.hovered && } diff --git a/src/renderer/component/link/view.jsx b/src/renderer/component/link/view.jsx index cfb2a731b..0f5ea3fca 100644 --- a/src/renderer/component/link/view.jsx +++ b/src/renderer/component/link/view.jsx @@ -16,6 +16,7 @@ const Link = props => { navigateParams, doNavigate, className, + span, } = props; const combinedClassName = @@ -26,7 +27,8 @@ const Link = props => { const onClick = !props.onClick && navigate - ? () => { + ? e => { + e.stopPropagation(); doNavigate(navigate, navigateParams || {}); } : props.onClick; @@ -44,16 +46,18 @@ const Link = props => { ); } - return ( - - {content} - + const linkProps = { + className: combinedClassName, + href: href || "javascript:;", + title, + onClick, + style, + }; + + return span ? ( + {content} + ) : ( + {content} ); }; diff --git a/src/renderer/component/uriIndicator/view.jsx b/src/renderer/component/uriIndicator/view.jsx index 3bf850d11..60b912e35 100644 --- a/src/renderer/component/uriIndicator/view.jsx +++ b/src/renderer/component/uriIndicator/view.jsx @@ -22,7 +22,7 @@ class UriIndicator extends React.PureComponent { } render() { - const { claim, link, uri, isResolvingUri, smallCard } = this.props; + const { claim, link, uri, isResolvingUri, smallCard, span } = this.props; if (isResolvingUri && !claim) { return Validating...; @@ -91,6 +91,7 @@ class UriIndicator extends React.PureComponent { navigate="/show" navigateParams={{ uri: channelLink }} className="no-underline" + span={span} > {inner} From c4c43e1219d862b00658c6c704713aab7cd46399 Mon Sep 17 00:00:00 2001 From: Igor Gassmann Date: Fri, 15 Dec 2017 17:33:01 -0300 Subject: [PATCH 04/19] Add linux app category --- electron-builder.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/electron-builder.json b/electron-builder.json index acf8e77a2..9e0a8f86b 100644 --- a/electron-builder.json +++ b/electron-builder.json @@ -1,7 +1,7 @@ { "appId": "io.lbry.LBRY", "mac": { - "category": "public.app-category.entertainment", + "category": "public.app-category.entertainment" }, "dmg": { "iconSize": 128, @@ -34,6 +34,7 @@ ], "linux": { "target": "deb", + "category": "Video", "desktop": { "MimeType": "x-scheme-handler/lbry", "Exec": "/opt/LBRY/lbry %U" From 1d67f8df9cb36f66deed9a5522266c34193103f2 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Fri, 15 Dec 2017 15:46:50 -0500 Subject: [PATCH 05/19] add copy button to wallet address, fixes #875 --- CHANGELOG.md | 2 +- src/renderer/component/walletAddress/view.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e66e97c3e..7a57edac4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ Web UI version numbers should always match the corresponding version of LBRY App ## [Unreleased] ### Added - * + * Added copy address button to the Wallet Address component on Send / Receive (#875) * ### Changed diff --git a/src/renderer/component/walletAddress/view.jsx b/src/renderer/component/walletAddress/view.jsx index 829955fa6..72bb91a46 100644 --- a/src/renderer/component/walletAddress/view.jsx +++ b/src/renderer/component/walletAddress/view.jsx @@ -21,7 +21,7 @@ class WalletAddress extends React.PureComponent { "Use this wallet address to receive credits sent by another user (or yourself)." )}

-
+
Date: Fri, 15 Dec 2017 21:12:59 -0800 Subject: [PATCH 06/19] Updated contribution process --- CONTRIBUTING.md | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e7d0dce20..a64256fb0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,37 @@ ## Contributing to LBRY -https://lbry.io/faq/contributing +You found this page! That means you are well on your way to contributing to the LBRY app. This application is primarily written in JavaScript and is built on [Electron](https://electronjs.org) while utilizing [React](https://reactjs.org) and [Redux](https://redux.js.org) for UI and application state. + +LBRY is an open source project, and therefore is developed out in the open for everyone to see. What you see here are the latest source code changes and the issues. + +Since LBRY is an based around a decentralized community, we believe that the app will be strongest if it receives contributions from individuals outside the core team -- such as yourself! + +In order to make contributing as easy and rewarding of possible, we have instituted the following system: + +* Anyone can view all issues in the system by clicking on the [Issues](https://github.com/lbryio/lbry-app/issues) button at the top of the page. +...Feel free to add an issue if you think we have missed something (and you might earn some LBC in the process because we do tip people for reporting bugs). +* Once on the [Issues](https://github.com/lbryio/lbry-app/issues) page, a user can filter issues by the [Help Wanted](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) label to see a curated list of suggested issues with which community members can help. +* Every [Help Wanted](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) issue is ranked on a scale from zero to four. +...--- | --- +...[**level 0**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+0%22) | Typos and text edit -- a tech savvy non-programmer can fix these +...[**level 1**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+1%22) | Programming issues that require little knowledge of how the LBRY app works +...[**level 2**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+2%22) | Issues of average difficulty that require the developer to dig into how the app works a little bit +...[**level 3**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+3%22) | Issues that are likely too tricky to be level 2 or require more thinking outside of the box +...[**level 4**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+4%22) | Big features or really hard issues +...The process of ranking issues is highly subjective. The purpose of sorting issues like this is to give contributors a general idea of the type of issues at which they are looking. It could very well be the case that a level 1 issue is more difficult than a level 2, for instance. This system is meant to help you find relevant issues, not to prevent you from working on issues that you otherwise would. If these rankings don't work for you, feel free to ignore them. +* After deciding what to work on, [fork](https://help.github.com/articles/fork-a-repo/) this repository, make your changes, and submit a [pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/). +* Once your pull request is visible in the LBRY repo, a LBRY team member will review it and make sure it is up to our standards. At this point, you may have to change your code based on our suggestions and comments. +* Then, upon a satisfactory review your code, we will merge it and send you a tip (in LBC) for your contribution. + +We are dedicated to be fair and friendly in this process. In __general__, level 4 issues will be paid more than level 3 issues which will be paid more than level 2, and so on. However, this is not due to their labels, but rather how difficult they ended up being. Maybe an issue was labeled level 1 but was actually very difficult-- in this case we would be **more than happy** to tip accordingly. If you do good work, we want you to be rewarded for it. + +Also, we are here to enable you. We want you to succeed, so do not hesitate to ask questions. If you need some information or assistance in completely an issue, please let us know! This is what we are here for-- pushing development forward. + +Lastly, don't feel limited by this list. Should LBRY have built in VPN/proxy support? Add it! It's not in the issue tracker but maybe it's a good idea. Do you think the search layout is unintuitive? Change it! We welcome all feedback and suggestions. That said, it may be the case that we do not wish to incorporate your change, if you don't check with us first. If you want to add a feature that is not listed in the issue tracker, go ahead and [create an issue](https://github.com/lbryio/lbry-app/issues/new), and say in the description that you would like to try to implement it yourself. This way we can tell you in advance if we will accept your changes and we can point you in the right direction. + +## Get In Touch +[Liam](https://github.com/liamcardenas) is the application engineer in charge of community development. He is the person to contact with any development/contribution related questions. Discord: liamsdouble, Email: liam@lbry.io +[Tom](https://github.com/tzarebczan) is the community manager. He knows more than anyone about the app and all of its flaws. Reach out to him with any questions about how the app works, if a bug has been reported, or if a feature should be requested. Discord: jigglytom, Email: tom@lbry.io +[Sean](https://github.com/seanyesmunt) is an application engineer who focuses largely on UI/UX. If you have a design or implementation question, feel free to reach out to him. Discord: sean, Email: sean@lbry.io + +More information about contributing to LBRY [here](https://lbry.io/faq/contributing). From 8d28babaf1fa5d1a8722cf52442f1f2f67201573 Mon Sep 17 00:00:00 2001 From: Liam Cardenas Date: Fri, 15 Dec 2017 21:42:55 -0800 Subject: [PATCH 07/19] Fixed typos and formatting issues --- CONTRIBUTING.md | 53 +++++++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a64256fb0..e9d7c9811 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,37 +1,46 @@ -## Contributing to LBRY +# Contributing to LBRY You found this page! That means you are well on your way to contributing to the LBRY app. This application is primarily written in JavaScript and is built on [Electron](https://electronjs.org) while utilizing [React](https://reactjs.org) and [Redux](https://redux.js.org) for UI and application state. -LBRY is an open source project, and therefore is developed out in the open for everyone to see. What you see here are the latest source code changes and the issues. +LBRY is an open source project, and therefore is developed out in the open for everyone to see. What you see here are the latest source code changes and issues. Since LBRY is an based around a decentralized community, we believe that the app will be strongest if it receives contributions from individuals outside the core team -- such as yourself! In order to make contributing as easy and rewarding of possible, we have instituted the following system: -* Anyone can view all issues in the system by clicking on the [Issues](https://github.com/lbryio/lbry-app/issues) button at the top of the page. -...Feel free to add an issue if you think we have missed something (and you might earn some LBC in the process because we do tip people for reporting bugs). -* Once on the [Issues](https://github.com/lbryio/lbry-app/issues) page, a user can filter issues by the [Help Wanted](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) label to see a curated list of suggested issues with which community members can help. +* Anyone can view all issues in the system by clicking on the [Issues](https://github.com/lbryio/lbry-app/issues) button at the top of the page. Feel free to add an issue if you think we have missed something (and you might earn some LBC in the process because we do tip people for reporting bugs). +* Once on the [Issues](https://github.com/lbryio/lbry-app/issues) page, a potential contributor can filter issues by the [Help Wanted](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) label to see a curated list of suggested issues with which community members can help. * Every [Help Wanted](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) issue is ranked on a scale from zero to four. -...--- | --- -...[**level 0**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+0%22) | Typos and text edit -- a tech savvy non-programmer can fix these -...[**level 1**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+1%22) | Programming issues that require little knowledge of how the LBRY app works -...[**level 2**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+2%22) | Issues of average difficulty that require the developer to dig into how the app works a little bit -...[**level 3**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+3%22) | Issues that are likely too tricky to be level 2 or require more thinking outside of the box -...[**level 4**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+4%22) | Big features or really hard issues -...The process of ranking issues is highly subjective. The purpose of sorting issues like this is to give contributors a general idea of the type of issues at which they are looking. It could very well be the case that a level 1 issue is more difficult than a level 2, for instance. This system is meant to help you find relevant issues, not to prevent you from working on issues that you otherwise would. If these rankings don't work for you, feel free to ignore them. -* After deciding what to work on, [fork](https://help.github.com/articles/fork-a-repo/) this repository, make your changes, and submit a [pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/). -* Once your pull request is visible in the LBRY repo, a LBRY team member will review it and make sure it is up to our standards. At this point, you may have to change your code based on our suggestions and comments. -* Then, upon a satisfactory review your code, we will merge it and send you a tip (in LBC) for your contribution. -We are dedicated to be fair and friendly in this process. In __general__, level 4 issues will be paid more than level 3 issues which will be paid more than level 2, and so on. However, this is not due to their labels, but rather how difficult they ended up being. Maybe an issue was labeled level 1 but was actually very difficult-- in this case we would be **more than happy** to tip accordingly. If you do good work, we want you to be rewarded for it. +Level | Description +--- | --- +[**level 0**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+0%22) | Typos and text edits -- a tech savvy non-programmer can fix these +[**level 1**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+1%22) | Programming issues that require little knowledge of how the LBRY app works +[**level 2**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+2%22) | Issues of average difficulty that require the developer to dig into how the app works a little bit +[**level 3**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+3%22) | Issues that are likely too tricky to be level 2 or require more thinking outside of the box +[**level 4**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+4%22) | Big features or really hard issues -Also, we are here to enable you. We want you to succeed, so do not hesitate to ask questions. If you need some information or assistance in completely an issue, please let us know! This is what we are here for-- pushing development forward. +The process of ranking issues is highly subjective. The purpose of sorting issues like this is to give contributors a general idea of the type of issues at which they are looking. It could very well be the case that a level 1 issue is more difficult than a level 2, for instance. This system is meant to help you find relevant issues, not to prevent you from working on issues that you otherwise would. If these rankings don't work for you, feel free to ignore them. -Lastly, don't feel limited by this list. Should LBRY have built in VPN/proxy support? Add it! It's not in the issue tracker but maybe it's a good idea. Do you think the search layout is unintuitive? Change it! We welcome all feedback and suggestions. That said, it may be the case that we do not wish to incorporate your change, if you don't check with us first. If you want to add a feature that is not listed in the issue tracker, go ahead and [create an issue](https://github.com/lbryio/lbry-app/issues/new), and say in the description that you would like to try to implement it yourself. This way we can tell you in advance if we will accept your changes and we can point you in the right direction. +* After deciding what to work on, a potential contributor can [fork](https://help.github.com/articles/fork-a-repo/) this repository, make his or her changes, and submit a [pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/). +* Once the pull request is visible in the LBRY repo, a LBRY team member will review it and make sure it is up to our standards. At this point, the contributor may have to change his or her code based on our suggestions and comments. +* Then, upon a satisfactory review of the code, we will merge it and send the contributor a tip (in LBC) for the contribution. -## Get In Touch -[Liam](https://github.com/liamcardenas) is the application engineer in charge of community development. He is the person to contact with any development/contribution related questions. Discord: liamsdouble, Email: liam@lbry.io -[Tom](https://github.com/tzarebczan) is the community manager. He knows more than anyone about the app and all of its flaws. Reach out to him with any questions about how the app works, if a bug has been reported, or if a feature should be requested. Discord: jigglytom, Email: tom@lbry.io -[Sean](https://github.com/seanyesmunt) is an application engineer who focuses largely on UI/UX. If you have a design or implementation question, feel free to reach out to him. Discord: sean, Email: sean@lbry.io +We are dedicated to being fair and friendly in this process. In __general__, level 4 issues will be paid more than level 3 issues which will be paid more than level 2, and so on. However, this is not due to their labels, but rather how difficult they ended up being. Maybe an issue labeled "level 1" turned out to be very difficult. In this case we would be **more than happy** to tip accordingly. If you do good work, we want you to be rewarded for it. + +Also, we are here to enable you. We want you to succeed, so do not hesitate to ask questions. If you need some information or assistance in completing an issue, please let us know! That is what we are here for-- pushing development forward. + +Lastly, don't feel limited by this list. Should LBRY have built-in Tor support? Add it! It's not in the issue tracker but maybe it's a good idea. Do you think the search layout is unintuitive? Change it! We welcome all feedback and suggestions. That said, it may be the case that we do not wish to incorporate your change if you don't check with us first (also, please check with us especially if you are planning on adding Tor support :P). If you want to add a feature that is not listed in the issue tracker, go ahead and [create an issue](https://github.com/lbryio/lbry-app/issues/new), and say in the description that you would like to try to implement it yourself. This way we can tell you in advance if we will accept your changes and we can point you in the right direction. + +# Get In Touch +Name | Role | Discord | Email +--- | --- | --- | --- +[Liam](https://github.com/liamcardenas) | The application engineer in charge of community development. He is the person to contact with any development/contribution related questions. | liamsdouble | liam@lbry.io +[Tom](https://github.com/tzarebczan) | Community manager. He knows more than anyone about the app and all of its flaws. Reach out to him with any questions about how the app works, if a bug has been reported, or if a feature should be requested. | jigglytom | tom@lbry.io +[Sean](https://github.com/seanyesmunt) | An application engineer who focuses largely on UI/UX. If you have a design or implementation question, feel free to reach out to him. | sean | sean@lbry.io + +Join our discord [here](https://chat.lbry.io/). + +# More Information More information about contributing to LBRY [here](https://lbry.io/faq/contributing). From bd3aa1b3493ea3ec03fde94c3c4ee388f6abcf45 Mon Sep 17 00:00:00 2001 From: Travis Eden Date: Mon, 18 Dec 2017 12:02:55 -0500 Subject: [PATCH 08/19] Pushing for help with Redux selectors --- .../component/fileDownloadLink/index.js | 2 ++ .../component/fileDownloadLink/view.jsx | 9 +++++- src/renderer/component/video/index.js | 2 ++ .../component/video/internal/player.jsx | 12 +++++++- src/renderer/component/video/view.jsx | 5 ++++ src/renderer/constants/action_types.js | 5 ++++ src/renderer/redux/actions/video.js | 24 +++++++++++++++ src/renderer/redux/reducers/video.js | 29 +++++++++++++++++++ src/renderer/redux/selectors/video.js | 9 ++++++ src/renderer/store.js | 4 ++- 10 files changed, 98 insertions(+), 3 deletions(-) create mode 100644 src/renderer/redux/actions/video.js create mode 100644 src/renderer/redux/reducers/video.js create mode 100644 src/renderer/redux/selectors/video.js diff --git a/src/renderer/component/fileDownloadLink/index.js b/src/renderer/component/fileDownloadLink/index.js index d7988c067..9b1141802 100644 --- a/src/renderer/component/fileDownloadLink/index.js +++ b/src/renderer/component/fileDownloadLink/index.js @@ -9,6 +9,7 @@ import { makeSelectCostInfoForUri } from "redux/selectors/cost_info"; import { doFetchAvailability } from "redux/actions/availability"; import { doOpenFileInShell } from "redux/actions/file_info"; import { doPurchaseUri, doStartDownload } from "redux/actions/content"; +import { setVideoPause } from "redux/actions/video"; import FileDownloadLink from "./view"; const select = (state, props) => ({ @@ -24,6 +25,7 @@ const perform = dispatch => ({ openInShell: path => dispatch(doOpenFileInShell(path)), purchaseUri: uri => dispatch(doPurchaseUri(uri)), restartDownload: (uri, outpoint) => dispatch(doStartDownload(uri, outpoint)), + videoPause: val => dispatch(setVideoPause(val)), }); export default connect(select, perform)(FileDownloadLink); diff --git a/src/renderer/component/fileDownloadLink/view.jsx b/src/renderer/component/fileDownloadLink/view.jsx index 32d0fe3c4..68499c273 100644 --- a/src/renderer/component/fileDownloadLink/view.jsx +++ b/src/renderer/component/fileDownloadLink/view.jsx @@ -42,8 +42,15 @@ class FileDownloadLink extends React.PureComponent { purchaseUri, costInfo, loading, + videoPause, } = this.props; + const openFile = () => { + openInShell(fileInfo.download_path); + console.log("FileDownloadLink view"); + videoPause(true); + }; + if (loading || downloading) { const progress = fileInfo && fileInfo.written_bytes @@ -93,7 +100,7 @@ class FileDownloadLink extends React.PureComponent { button="text" icon="icon-external-link-square" className="no-underline" - onClick={() => openInShell(fileInfo.download_path)} + onClick={() => openFile()} /> ); } diff --git a/src/renderer/component/video/index.js b/src/renderer/component/video/index.js index a9b0ed62d..1b79f8275 100644 --- a/src/renderer/component/video/index.js +++ b/src/renderer/component/video/index.js @@ -14,6 +14,7 @@ import { } from "redux/selectors/file_info"; import { makeSelectCostInfoForUri } from "redux/selectors/cost_info"; import { selectShowNsfw } from "redux/selectors/settings"; +import { selectVideoPause } from "redux/selectors/video"; import Video from "./view"; import { selectPlayingUri } from "redux/selectors/content"; @@ -27,6 +28,7 @@ const select = (state, props) => ({ playingUri: selectPlayingUri(state), contentType: makeSelectContentTypeForUri(props.uri)(state), volume: selectVolume(state), + videoPause: selectVideoPause(state), }); const perform = dispatch => ({ diff --git a/src/renderer/component/video/internal/player.jsx b/src/renderer/component/video/internal/player.jsx index 9d7b6608f..5c885bc80 100644 --- a/src/renderer/component/video/internal/player.jsx +++ b/src/renderer/component/video/internal/player.jsx @@ -5,6 +5,9 @@ import player from "render-media"; import fs from "fs"; import LoadingScreen from "./loading-screen"; +import { connect } from "react-redux"; +import { selectVideoPause } from "redux/selectors/video"; + class VideoPlayer extends React.PureComponent { static MP3_CONTENT_TYPES = ["audio/mpeg3", "audio/mpeg"]; @@ -121,6 +124,11 @@ class VideoPlayer extends React.PureComponent { } } + pauseVideo() { + console.log("pauseVideo called"); + this.refs.media.children[0].pause(); + } + componentDidUpdate() { const { contentType, downloadCompleted } = this.props; const { startedPlaying } = this.state; @@ -157,13 +165,15 @@ class VideoPlayer extends React.PureComponent { } render() { - const { mediaType, poster } = this.props; + const { mediaType, poster, videoPause } = this.props; const { hasMetadata, unplayable } = this.state; const noMetadataMessage = "Waiting for metadata."; const unplayableMessage = "Sorry, looks like we can't play this file."; const needsMetadata = this.playableType(); + console.log("VideoPlayer render; videoPause:", videoPause); + return (
{["audio", "application"].indexOf(mediaType) !== -1 && diff --git a/src/renderer/component/video/view.jsx b/src/renderer/component/video/view.jsx index c42994a17..515a6c8e3 100644 --- a/src/renderer/component/video/view.jsx +++ b/src/renderer/component/video/view.jsx @@ -8,6 +8,7 @@ import NsfwOverlay from "component/nsfwOverlay"; class Video extends React.PureComponent { constructor(props) { super(props); + console.log("PROPS:", props); this.state = { showNsfwHelp: false, }; @@ -56,8 +57,11 @@ class Video extends React.PureComponent { changeVolume, volume, uri, + videoPause, } = this.props; + console.log("VIDEO VIEW videoPause:", videoPause); + const isPlaying = playingUri === uri; const isReadyToPlay = fileInfo && fileInfo.written_bytes > 0; const obscureNsfw = this.props.obscureNsfw && metadata && metadata.nsfw; @@ -110,6 +114,7 @@ class Video extends React.PureComponent { downloadCompleted={fileInfo.completed} changeVolume={changeVolume} volume={volume} + videoPause={videoPause} /> ))} {!isPlaying && ( diff --git a/src/renderer/constants/action_types.js b/src/renderer/constants/action_types.js index f9e8eb836..d83cf10ed 100644 --- a/src/renderer/constants/action_types.js +++ b/src/renderer/constants/action_types.js @@ -164,3 +164,8 @@ export const CLEAR_SHAPE_SHIFT = "CLEAR_SHAPE_SHIFT"; export const CHANNEL_SUBSCRIBE = "CHANNEL_SUBSCRIBE"; export const CHANNEL_UNSUBSCRIBE = "CHANNEL_UNSUBSCRIBE"; export const HAS_FETCHED_SUBSCRIPTIONS = "HAS_FETCHED_SUBSCRIPTIONS"; + +// Video controls +export const VIDEO_PAUSE_STARTED = "VIDEO_PAUSE_STARTED"; +export const VIDEO_PAUSE_COMPLETED = "VIDEO_PAUSE_COMPLETED"; +export const SET_VIDEO_PAUSE = "SET_VIDEO_PAUSE"; diff --git a/src/renderer/redux/actions/video.js b/src/renderer/redux/actions/video.js new file mode 100644 index 000000000..c4c8ec40a --- /dev/null +++ b/src/renderer/redux/actions/video.js @@ -0,0 +1,24 @@ +// @flow +import * as actions from "constants/action_types"; +import type { Action, Dispatch } from "redux/reducers/video"; +import lbry from "lbry"; + +// export const doVideoPause = ( +// dispatch: Dispatch +// ) => { +// console.log("diVideoPause helllllo"); +// console.log(dispatch); +// return dispatch({type: actions.VIDEO_PAUSE_STARTED}); +// } + +// export const confirmVideoPause = ( +// dispatch: Dispatch +// ) => dispatch({type: actions.VIDEO_PAUSE_COMPLETED}); + +export const setVideoPause = (data: boolean) => (dispatch: Dispatch) => { + console.log("VIDEO ACTION data:", data); + return dispatch({ + type: actions.SET_VIDEO_PAUSE, + data, + }); +}; diff --git a/src/renderer/redux/reducers/video.js b/src/renderer/redux/reducers/video.js new file mode 100644 index 000000000..6aafaa9ec --- /dev/null +++ b/src/renderer/redux/reducers/video.js @@ -0,0 +1,29 @@ +// @flow +import * as actions from "constants/action_types"; +import { handleActions } from "util/redux-utils"; + +export type VideoState = { videoPause: boolean }; + +type setVideoPause = { + type: actions.SET_VIDEO_PAUSE, + data: boolean, +}; + +export type Action = setVideoPause; +export type Dispatch = (action: Action) => any; + +const defaultState = { videoPause: false }; + +export default handleActions( + { + [actions.SET_VIDEO_PAUSE]: ( + state: VideoState, + action: setVideoPause + ): VideoState => { + console.log("VIDEO REDUCER STATE", state); + console.log("VIDEO REDUCER ACTION", action); + return { ...state, videoPause: action.data }; + }, + }, + defaultState +); diff --git a/src/renderer/redux/selectors/video.js b/src/renderer/redux/selectors/video.js new file mode 100644 index 000000000..fc124a69a --- /dev/null +++ b/src/renderer/redux/selectors/video.js @@ -0,0 +1,9 @@ +import * as settings from "constants/settings"; +import { createSelector } from "reselect"; + +const _selectState = state => state.videoPause || false; + +export const selectVideoPause = createSelector( + _selectState, + state => state.videoPause || false +); diff --git a/src/renderer/store.js b/src/renderer/store.js index 9e6176b0e..f4a61f779 100644 --- a/src/renderer/store.js +++ b/src/renderer/store.js @@ -13,6 +13,7 @@ import userReducer from "redux/reducers/user"; import walletReducer from "redux/reducers/wallet"; import shapeShiftReducer from "redux/reducers/shape_shift"; import subscriptionsReducer from "redux/reducers/subscriptions"; +import videoReducer from "redux/reducers/video"; import { persistStore, autoRehydrate } from "redux-persist"; import createCompressor from "redux-persist-transform-compress"; import createFilter from "redux-persist-transform-filter"; @@ -20,7 +21,7 @@ import localForage from "localforage"; import { createStore, applyMiddleware, compose, combineReducers } from "redux"; import thunk from "redux-thunk"; -const env = process.env.NODE_ENV || "production" +const env = process.env.NODE_ENV || "production"; function isFunction(object) { return typeof object === "function"; @@ -69,6 +70,7 @@ const reducers = combineReducers({ user: userReducer, shapeShift: shapeShiftReducer, subscriptions: subscriptionsReducer, + video: videoReducer, }); const bulkThunk = createBulkThunkMiddleware(); From 11ee87829d47cd5f2597c9ce00af8cc10cb4b280 Mon Sep 17 00:00:00 2001 From: Travis Eden Date: Mon, 18 Dec 2017 17:44:04 -0500 Subject: [PATCH 09/19] getting closer --- src/renderer/component/video/index.js | 4 +- .../component/video/internal/player.jsx | 38 ++++++++++++------- src/renderer/component/video/view.jsx | 5 +-- 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/src/renderer/component/video/index.js b/src/renderer/component/video/index.js index 1b79f8275..b709dd691 100644 --- a/src/renderer/component/video/index.js +++ b/src/renderer/component/video/index.js @@ -14,7 +14,7 @@ import { } from "redux/selectors/file_info"; import { makeSelectCostInfoForUri } from "redux/selectors/cost_info"; import { selectShowNsfw } from "redux/selectors/settings"; -import { selectVideoPause } from "redux/selectors/video"; +// import { selectVideoPause } from "redux/selectors/video"; import Video from "./view"; import { selectPlayingUri } from "redux/selectors/content"; @@ -28,7 +28,7 @@ const select = (state, props) => ({ playingUri: selectPlayingUri(state), contentType: makeSelectContentTypeForUri(props.uri)(state), volume: selectVolume(state), - videoPause: selectVideoPause(state), + // videoPause: selectVideoPause(state), }); const perform = dispatch => ({ diff --git a/src/renderer/component/video/internal/player.jsx b/src/renderer/component/video/internal/player.jsx index 5c885bc80..d18733aec 100644 --- a/src/renderer/component/video/internal/player.jsx +++ b/src/renderer/component/video/internal/player.jsx @@ -124,9 +124,10 @@ class VideoPlayer extends React.PureComponent { } } - pauseVideo() { - console.log("pauseVideo called"); - this.refs.media.children[0].pause(); + componentWillReceiveProps() { + console.log("!!VIDEO PLAYA RECIEVE PROPS:", this.props); + // console.log("pauseVideo called"); + // this.refs.media.children[0].pause(); } componentDidUpdate() { @@ -176,19 +177,28 @@ class VideoPlayer extends React.PureComponent { return (
- {["audio", "application"].indexOf(mediaType) !== -1 && - (!this.playableType() || hasMetadata) && - !unplayable && } - {this.playableType() && - !hasMetadata && - !unplayable && } - {unplayable && ( - - )} -
+

videoPause: {videoPause}

+
+ {["audio", "application"].indexOf(mediaType) !== -1 && + (!this.playableType() || hasMetadata) && + !unplayable && ( + + )} + {this.playableType() && + !hasMetadata && + !unplayable && } + {unplayable && ( + + )} +
+
); } } -export default VideoPlayer; +const select = (state, props) => ({ + videoPause: selectVideoPause(state), +}); + +export default connect(select, {})(VideoPlayer); diff --git a/src/renderer/component/video/view.jsx b/src/renderer/component/video/view.jsx index 515a6c8e3..72e0e164d 100644 --- a/src/renderer/component/video/view.jsx +++ b/src/renderer/component/video/view.jsx @@ -57,10 +57,10 @@ class Video extends React.PureComponent { changeVolume, volume, uri, - videoPause, + // videoPause, } = this.props; - console.log("VIDEO VIEW videoPause:", videoPause); + // console.log("VIDEO VIEW videoPause:", videoPause); const isPlaying = playingUri === uri; const isReadyToPlay = fileInfo && fileInfo.written_bytes > 0; @@ -114,7 +114,6 @@ class Video extends React.PureComponent { downloadCompleted={fileInfo.completed} changeVolume={changeVolume} volume={volume} - videoPause={videoPause} /> ))} {!isPlaying && ( From a015a44c9d840a3fa5a0cb0e2d2fc2ba2bd2bfe7 Mon Sep 17 00:00:00 2001 From: Travis Eden Date: Mon, 18 Dec 2017 18:12:52 -0500 Subject: [PATCH 10/19] back to connecting selectors through index.js --- src/renderer/component/video/index.js | 4 +- .../component/video/internal/player.jsx | 41 ++++++------------- src/renderer/component/video/view.jsx | 8 +++- 3 files changed, 22 insertions(+), 31 deletions(-) diff --git a/src/renderer/component/video/index.js b/src/renderer/component/video/index.js index b709dd691..1b79f8275 100644 --- a/src/renderer/component/video/index.js +++ b/src/renderer/component/video/index.js @@ -14,7 +14,7 @@ import { } from "redux/selectors/file_info"; import { makeSelectCostInfoForUri } from "redux/selectors/cost_info"; import { selectShowNsfw } from "redux/selectors/settings"; -// import { selectVideoPause } from "redux/selectors/video"; +import { selectVideoPause } from "redux/selectors/video"; import Video from "./view"; import { selectPlayingUri } from "redux/selectors/content"; @@ -28,7 +28,7 @@ const select = (state, props) => ({ playingUri: selectPlayingUri(state), contentType: makeSelectContentTypeForUri(props.uri)(state), volume: selectVolume(state), - // videoPause: selectVideoPause(state), + videoPause: selectVideoPause(state), }); const perform = dispatch => ({ diff --git a/src/renderer/component/video/internal/player.jsx b/src/renderer/component/video/internal/player.jsx index d18733aec..a8b4572c1 100644 --- a/src/renderer/component/video/internal/player.jsx +++ b/src/renderer/component/video/internal/player.jsx @@ -5,8 +5,8 @@ import player from "render-media"; import fs from "fs"; import LoadingScreen from "./loading-screen"; -import { connect } from "react-redux"; -import { selectVideoPause } from "redux/selectors/video"; +// import { connect } from "react-redux"; +// import { selectVideoPause } from "redux/selectors/video"; class VideoPlayer extends React.PureComponent { static MP3_CONTENT_TYPES = ["audio/mpeg3", "audio/mpeg"]; @@ -124,12 +124,6 @@ class VideoPlayer extends React.PureComponent { } } - componentWillReceiveProps() { - console.log("!!VIDEO PLAYA RECIEVE PROPS:", this.props); - // console.log("pauseVideo called"); - // this.refs.media.children[0].pause(); - } - componentDidUpdate() { const { contentType, downloadCompleted } = this.props; const { startedPlaying } = this.state; @@ -177,28 +171,19 @@ class VideoPlayer extends React.PureComponent { return (
-

videoPause: {videoPause}

-
- {["audio", "application"].indexOf(mediaType) !== -1 && - (!this.playableType() || hasMetadata) && - !unplayable && ( - - )} - {this.playableType() && - !hasMetadata && - !unplayable && } - {unplayable && ( - - )} -
-
+ {["audio", "application"].indexOf(mediaType) !== -1 && + (!this.playableType() || hasMetadata) && + !unplayable && } + {this.playableType() && + !hasMetadata && + !unplayable && } + {unplayable && ( + + )} +
); } } -const select = (state, props) => ({ - videoPause: selectVideoPause(state), -}); - -export default connect(select, {})(VideoPlayer); +export default VideoPlayer; diff --git a/src/renderer/component/video/view.jsx b/src/renderer/component/video/view.jsx index 72e0e164d..5a2b5fc99 100644 --- a/src/renderer/component/video/view.jsx +++ b/src/renderer/component/video/view.jsx @@ -8,12 +8,18 @@ import NsfwOverlay from "component/nsfwOverlay"; class Video extends React.PureComponent { constructor(props) { super(props); - console.log("PROPS:", props); + console.log("video view props", props); this.state = { showNsfwHelp: false, }; } + componentWillReceiveProps() { + console.log("!!VIDEO PLAYA RECIEVE PROPS:", this.props); + // console.log("pauseVideo called"); + // this.refs.media.children[0].pause(); + } + componentWillUnmount() { this.props.cancelPlay(); } From f407cd91a13f5b5ca2f625434824480abcf36936 Mon Sep 17 00:00:00 2001 From: Liam Cardenas Date: Mon, 18 Dec 2017 21:53:01 -0800 Subject: [PATCH 11/19] Move analytics out of redux folder --- src/renderer/index.js | 20 ++++++++++++++++---- src/renderer/redux/actions/navigation.js | 3 --- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/renderer/index.js b/src/renderer/index.js index 155278bda..d5154b084 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -19,8 +19,10 @@ const contextMenu = remote.require("./main.js").contextMenu; const app = require("./app"); // Workaround for https://github.com/electron-userland/electron-webpack/issues/52 -if (process.env.NODE_ENV !== 'development') { - window.staticResourcesPath = require("path").join(remote.app.getAppPath(), "../static").replace(/\\/g, "\\\\"); +if (process.env.NODE_ENV !== "development") { + window.staticResourcesPath = require("path") + .join(remote.app.getAppPath(), "../static") + .replace(/\\/g, "\\\\"); } else { window.staticResourcesPath = ""; } @@ -55,6 +57,16 @@ ipcRenderer.on("window-is-focused", (event, data) => { dock.setBadge(""); }); +(function(history) { + var replaceState = history.replaceState; + history.replaceState = function(_, __, path) { + amplitude + .getInstance() + .logEvent("NAVIGATION", { destination: path ? path.slice(1) : path }); + return replaceState.apply(history, arguments); + }; +})(window.history); + document.addEventListener("click", event => { var target = event.target; while (target && target !== document) { @@ -110,7 +122,7 @@ var init = function() {
, - document.getElementById('app') + document.getElementById("app") ); } ); @@ -124,7 +136,7 @@ var init = function() { , - document.getElementById('app') + document.getElementById("app") ); } }; diff --git a/src/renderer/redux/actions/navigation.js b/src/renderer/redux/actions/navigation.js index a4cbca615..b718936aa 100644 --- a/src/renderer/redux/actions/navigation.js +++ b/src/renderer/redux/actions/navigation.js @@ -9,7 +9,6 @@ import { } from "redux/selectors/navigation"; import { doSearch } from "redux/actions/search"; import { toQueryString } from "util/query_params"; -import amplitude from "amplitude-js"; export function doNavigate(path, params = {}, options = {}) { return function(dispatch, getState) { @@ -24,8 +23,6 @@ export function doNavigate(path, params = {}, options = {}) { const scrollY = options.scrollY; - amplitude.getInstance().logEvent("NAVIGATION", { destination: url }); - dispatch({ type: types.HISTORY_NAVIGATE, data: { url, index: options.index, scrollY }, From a9863b90820930f0b8aaffbdf4ef294397efb6b3 Mon Sep 17 00:00:00 2001 From: Liam Cardenas Date: Mon, 18 Dec 2017 22:34:03 -0800 Subject: [PATCH 12/19] Improve click analytics --- src/renderer/component/header/view.jsx | 1 + src/renderer/index.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/renderer/component/header/view.jsx b/src/renderer/component/header/view.jsx index 1e83abbe7..b3b6cdc51 100644 --- a/src/renderer/component/header/view.jsx +++ b/src/renderer/component/header/view.jsx @@ -46,6 +46,7 @@ export const Header = props => { onClick={() => navigate("/subscriptions")} button="alt button--flat" icon="icon-at" + title={__("My Subscriptions")} />
diff --git a/src/renderer/index.js b/src/renderer/index.js index d5154b084..e3ed7836b 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -73,7 +73,8 @@ document.addEventListener("click", event => { if (target.matches("a") || target.matches("button")) { // TODO: Look into using accessiblity labels (this would also make the app more accessible) let hrefParts = window.location.href.split("#"); - let element = target.title || (target.text && target.text.trim()); + let element = + target.title || (target.textContent && target.textContent.trim()); if (element) { amplitude.getInstance().logEvent("CLICK", { target: element, @@ -84,6 +85,7 @@ document.addEventListener("click", event => { amplitude.getInstance().logEvent("UNMARKED_CLICK", { location: hrefParts.length > 1 ? hrefParts[hrefParts.length - 1] : "/", + source: target.outerHTML, }); } } From 3f067f13cfdd011f04db196cfbc83c8ccc26fa2e Mon Sep 17 00:00:00 2001 From: Liam Cardenas Date: Mon, 18 Dec 2017 23:25:58 -0800 Subject: [PATCH 13/19] Update CONTRIBUTING.md --- CONTRIBUTING.md | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e9d7c9811..3724771ff 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,29 +9,33 @@ Since LBRY is an based around a decentralized community, we believe that the app In order to make contributing as easy and rewarding of possible, we have instituted the following system: * Anyone can view all issues in the system by clicking on the [Issues](https://github.com/lbryio/lbry-app/issues) button at the top of the page. Feel free to add an issue if you think we have missed something (and you might earn some LBC in the process because we do tip people for reporting bugs). -* Once on the [Issues](https://github.com/lbryio/lbry-app/issues) page, a potential contributor can filter issues by the [Help Wanted](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) label to see a curated list of suggested issues with which community members can help. -* Every [Help Wanted](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) issue is ranked on a scale from zero to four. +* Once on the [Issues](https://github.com/lbryio/lbry-app/issues) page, a potential contributor can filter issues by the [Help Wanted](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+no%3Aassignee) label to see a curated list of suggested issues with which community members can help. +* Every [Help Wanted](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+no%3Aassignee) issue is ranked on a scale from zero to four. Level | Description --- | --- -[**level 0**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+0%22) | Typos and text edits -- a tech savvy non-programmer can fix these -[**level 1**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+1%22) | Programming issues that require little knowledge of how the LBRY app works -[**level 2**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+2%22) | Issues of average difficulty that require the developer to dig into how the app works a little bit -[**level 3**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+3%22) | Issues that are likely too tricky to be level 2 or require more thinking outside of the box -[**level 4**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+4%22) | Big features or really hard issues +[**level 0**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+0%22+no%3Aassignee) | Typos and text edits -- a tech savvy non-programmer can fix these +[**level 1**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+1%22+no%3Aassignee) | Programming issues that require little knowledge of how the LBRY app works +[**level 2**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+2%22+no%3Aassignee) | Issues of average difficulty that require the developer to dig into how the app works a little bit +[**level 3**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+3%22+no%3Aassignee) | Issues that are likely too tricky to be level 2 or require more thinking outside of the box +[**level 4**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+4%22+no%3Aassignee) | Big features or really hard issues The process of ranking issues is highly subjective. The purpose of sorting issues like this is to give contributors a general idea of the type of issues at which they are looking. It could very well be the case that a level 1 issue is more difficult than a level 2, for instance. This system is meant to help you find relevant issues, not to prevent you from working on issues that you otherwise would. If these rankings don't work for you, feel free to ignore them. -* After deciding what to work on, a potential contributor can [fork](https://help.github.com/articles/fork-a-repo/) this repository, make his or her changes, and submit a [pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/). +* After deciding what to work on, a potential contributor can [fork](https://help.github.com/articles/fork-a-repo/) this repository, make his or her changes, and submit a [pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/). A contributor wanting to reserve an issue in advance can leave a comment saying that he or she is working on it. Contributors should respect other people's efforts to complete issues in a timely manner and, therefore, not begin working on anything reserved (or updated) within the last 3 days. If someone has been officially assigned an issue via Github's assignment system, it is also not available. Contributors are encouraged to ask if they have any questions about issue availability. * Once the pull request is visible in the LBRY repo, a LBRY team member will review it and make sure it is up to our standards. At this point, the contributor may have to change his or her code based on our suggestions and comments. * Then, upon a satisfactory review of the code, we will merge it and send the contributor a tip (in LBC) for the contribution. -We are dedicated to being fair and friendly in this process. In __general__, level 4 issues will be paid more than level 3 issues which will be paid more than level 2, and so on. However, this is not due to their labels, but rather how difficult they ended up being. Maybe an issue labeled "level 1" turned out to be very difficult. In this case we would be **more than happy** to tip accordingly. If you do good work, we want you to be rewarded for it. +We are dedicated to being fair and friendly in this process. In __general__, level 4 issues will be paid more than level 3 issues which will be paid more than level 2, and so on. However, this is not due to their labeling, but rather how difficult they end up being. Maybe an issue labeled "level 1" turns out to be very difficult. In this case we would be **more than happy** to tip accordingly. If you do good work, we want you to be rewarded for it. Also, we are here to enable you. We want you to succeed, so do not hesitate to ask questions. If you need some information or assistance in completing an issue, please let us know! That is what we are here for-- pushing development forward. Lastly, don't feel limited by this list. Should LBRY have built-in Tor support? Add it! It's not in the issue tracker but maybe it's a good idea. Do you think the search layout is unintuitive? Change it! We welcome all feedback and suggestions. That said, it may be the case that we do not wish to incorporate your change if you don't check with us first (also, please check with us especially if you are planning on adding Tor support :P). If you want to add a feature that is not listed in the issue tracker, go ahead and [create an issue](https://github.com/lbryio/lbry-app/issues/new), and say in the description that you would like to try to implement it yourself. This way we can tell you in advance if we will accept your changes and we can point you in the right direction. +# Tom's "Voice of the User" Wishlist + +[Anything marked with **both** "Help Wanted" and "Tom's 'Voice of the User' Wishlist"](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22Tom%27s+%5C%22Voice+of+the+User%5C%22+Wishlist%22+label%3A%22help+wanted%22+no%3Aassignee) will earn you an extra 50 LBC on top of what we would otherwise tip you. + # Get In Touch Name | Role | Discord | Email --- | --- | --- | --- From 1325b940318c27e0fbd51085ce760c76eeabaa2a Mon Sep 17 00:00:00 2001 From: Liam Cardenas Date: Mon, 18 Dec 2017 23:30:49 -0800 Subject: [PATCH 14/19] Added TL;DR --- CONTRIBUTING.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3724771ff..b6a4d8676 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,6 +2,14 @@ You found this page! That means you are well on your way to contributing to the LBRY app. This application is primarily written in JavaScript and is built on [Electron](https://electronjs.org) while utilizing [React](https://reactjs.org) and [Redux](https://redux.js.org) for UI and application state. +## TL;DR? +* [Here](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+no%3Aassignee) is a list of help wanted issues. +* Comment on an issue to let us know if you are going to work on it, don't take an issue that someone has reserved less than 3 days ago +* Submit a pull request and get paid in LBC +* Don't hesitate to contact us with any questions or comments + +## Longer Version + LBRY is an open source project, and therefore is developed out in the open for everyone to see. What you see here are the latest source code changes and issues. Since LBRY is an based around a decentralized community, we believe that the app will be strongest if it receives contributions from individuals outside the core team -- such as yourself! From 2f409a6cbd506a8e4079ab295c3675df81dc1ad8 Mon Sep 17 00:00:00 2001 From: Travis Eden Date: Tue, 19 Dec 2017 11:34:39 -0500 Subject: [PATCH 15/19] getting closer... --- src/renderer/component/video/view.jsx | 74 ++++++++++++++------------- src/renderer/redux/selectors/video.js | 10 ++-- 2 files changed, 44 insertions(+), 40 deletions(-) diff --git a/src/renderer/component/video/view.jsx b/src/renderer/component/video/view.jsx index 5a2b5fc99..cb474ea72 100644 --- a/src/renderer/component/video/view.jsx +++ b/src/renderer/component/video/view.jsx @@ -8,15 +8,16 @@ import NsfwOverlay from "component/nsfwOverlay"; class Video extends React.PureComponent { constructor(props) { super(props); - console.log("video view props", props); + // console.log("video view props", props); this.state = { showNsfwHelp: false, + // videoPause: false, }; } - componentWillReceiveProps() { - console.log("!!VIDEO PLAYA RECIEVE PROPS:", this.props); - // console.log("pauseVideo called"); + componentWillReceiveProps(nextProps) { + console.log("VIDEO COMPONENT WILL RECIEVE NEXTPROPS:", nextProps); + // this.setState({videoPause: nextProps.videoPause}); // this.refs.media.children[0].pause(); } @@ -63,10 +64,10 @@ class Video extends React.PureComponent { changeVolume, volume, uri, - // videoPause, + videoPause, } = this.props; - // console.log("VIDEO VIEW videoPause:", videoPause); + console.log("VIDEO VIEW videoPause:", videoPause); const isPlaying = playingUri === uri; const isReadyToPlay = fileInfo && fileInfo.written_bytes > 0; @@ -102,35 +103,38 @@ class Video extends React.PureComponent { const poster = metadata.thumbnail; return ( -
- {isPlaying && - (!isReadyToPlay ? ( - - ) : ( - - ))} - {!isPlaying && ( -
- -
- )} - {this.state.showNsfwHelp && } +
+

videoPause: {videoPause}

+
+ {isPlaying && + (!isReadyToPlay ? ( + + ) : ( + + ))} + {!isPlaying && ( +
+ +
+ )} + {this.state.showNsfwHelp && } +
); } diff --git a/src/renderer/redux/selectors/video.js b/src/renderer/redux/selectors/video.js index fc124a69a..e79bf8765 100644 --- a/src/renderer/redux/selectors/video.js +++ b/src/renderer/redux/selectors/video.js @@ -1,9 +1,9 @@ import * as settings from "constants/settings"; import { createSelector } from "reselect"; -const _selectState = state => state.videoPause || false; +const _selectState = state => state.video.videoPause || {}; -export const selectVideoPause = createSelector( - _selectState, - state => state.videoPause || false -); +export const selectVideoPause = createSelector(_selectState, state => { + console.log("VIDEO PAUSE SELECTOR", state); + return state.videoPause; +}); From 6175a464937ae1a587584c914018c9ef2110df90 Mon Sep 17 00:00:00 2001 From: Liam Cardenas Date: Tue, 19 Dec 2017 08:54:06 -0800 Subject: [PATCH 16/19] Reworded sentence --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b6a4d8676..10d01b548 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -28,7 +28,7 @@ Level | Description [**level 3**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+3%22+no%3Aassignee) | Issues that are likely too tricky to be level 2 or require more thinking outside of the box [**level 4**](https://github.com/lbryio/lbry-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level+4%22+no%3Aassignee) | Big features or really hard issues -The process of ranking issues is highly subjective. The purpose of sorting issues like this is to give contributors a general idea of the type of issues at which they are looking. It could very well be the case that a level 1 issue is more difficult than a level 2, for instance. This system is meant to help you find relevant issues, not to prevent you from working on issues that you otherwise would. If these rankings don't work for you, feel free to ignore them. +The process of ranking issues is highly subjective. The purpose of sorting issues like this is to give contributors a general idea about the type of issues they are looking at. It could very well be the case that a level 1 issue is more difficult than a level 2, for instance. This system is meant to help you find relevant issues, not to prevent you from working on issues that you otherwise would. If these rankings don't work for you, feel free to ignore them. * After deciding what to work on, a potential contributor can [fork](https://help.github.com/articles/fork-a-repo/) this repository, make his or her changes, and submit a [pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/). A contributor wanting to reserve an issue in advance can leave a comment saying that he or she is working on it. Contributors should respect other people's efforts to complete issues in a timely manner and, therefore, not begin working on anything reserved (or updated) within the last 3 days. If someone has been officially assigned an issue via Github's assignment system, it is also not available. Contributors are encouraged to ask if they have any questions about issue availability. * Once the pull request is visible in the LBRY repo, a LBRY team member will review it and make sure it is up to our standards. At this point, the contributor may have to change his or her code based on our suggestions and comments. From 92de445e1e1a51cfe77bddff3a4775e20cb43b05 Mon Sep 17 00:00:00 2001 From: Travis Eden Date: Tue, 19 Dec 2017 13:20:53 -0500 Subject: [PATCH 17/19] fixed selector; pause working; still need to call action from child component --- .../component/fileDownloadLink/index.js | 2 +- .../component/fileDownloadLink/view.jsx | 5 +- src/renderer/component/video/index.js | 1 + .../component/video/internal/player.jsx | 15 ++-- src/renderer/component/video/view.jsx | 79 +++++++++---------- src/renderer/redux/selectors/video.js | 2 +- 6 files changed, 52 insertions(+), 52 deletions(-) diff --git a/src/renderer/component/fileDownloadLink/index.js b/src/renderer/component/fileDownloadLink/index.js index 9b1141802..e35dc5b94 100644 --- a/src/renderer/component/fileDownloadLink/index.js +++ b/src/renderer/component/fileDownloadLink/index.js @@ -25,7 +25,7 @@ const perform = dispatch => ({ openInShell: path => dispatch(doOpenFileInShell(path)), purchaseUri: uri => dispatch(doPurchaseUri(uri)), restartDownload: (uri, outpoint) => dispatch(doStartDownload(uri, outpoint)), - videoPause: val => dispatch(setVideoPause(val)), + setVideoPause: val => dispatch(setVideoPause(val)), }); export default connect(select, perform)(FileDownloadLink); diff --git a/src/renderer/component/fileDownloadLink/view.jsx b/src/renderer/component/fileDownloadLink/view.jsx index 68499c273..0619460dd 100644 --- a/src/renderer/component/fileDownloadLink/view.jsx +++ b/src/renderer/component/fileDownloadLink/view.jsx @@ -42,13 +42,12 @@ class FileDownloadLink extends React.PureComponent { purchaseUri, costInfo, loading, - videoPause, + setVideoPause, } = this.props; const openFile = () => { openInShell(fileInfo.download_path); - console.log("FileDownloadLink view"); - videoPause(true); + setVideoPause(true); }; if (loading || downloading) { diff --git a/src/renderer/component/video/index.js b/src/renderer/component/video/index.js index 1b79f8275..04c223f61 100644 --- a/src/renderer/component/video/index.js +++ b/src/renderer/component/video/index.js @@ -35,6 +35,7 @@ const perform = dispatch => ({ play: uri => dispatch(doPlayUri(uri)), cancelPlay: () => dispatch(doSetPlayingUri(null)), changeVolume: volume => dispatch(doChangeVolume(volume)), + setVideoPause: val => dispatch(setVideoPause(val)), }); export default connect(select, perform)(Video); diff --git a/src/renderer/component/video/internal/player.jsx b/src/renderer/component/video/internal/player.jsx index a8b4572c1..42b9b4bf2 100644 --- a/src/renderer/component/video/internal/player.jsx +++ b/src/renderer/component/video/internal/player.jsx @@ -4,9 +4,7 @@ import { Thumbnail } from "component/common"; import player from "render-media"; import fs from "fs"; import LoadingScreen from "./loading-screen"; - -// import { connect } from "react-redux"; -// import { selectVideoPause } from "redux/selectors/video"; +import { setVideoPause } from "../../../redux/actions/video"; class VideoPlayer extends React.PureComponent { static MP3_CONTENT_TYPES = ["audio/mpeg3", "audio/mpeg"]; @@ -23,6 +21,13 @@ class VideoPlayer extends React.PureComponent { this.togglePlayListener = this.togglePlay.bind(this); } + componentWillReceiveProps(nextProps) { + if (nextProps.videoPause) { + this.refs.media.children[0].pause(); + this.props.confirmVideoPause(false); + } + } + componentDidMount() { const container = this.refs.media; const { @@ -160,15 +165,13 @@ class VideoPlayer extends React.PureComponent { } render() { - const { mediaType, poster, videoPause } = this.props; + const { mediaType, poster } = this.props; const { hasMetadata, unplayable } = this.state; const noMetadataMessage = "Waiting for metadata."; const unplayableMessage = "Sorry, looks like we can't play this file."; const needsMetadata = this.playableType(); - console.log("VideoPlayer render; videoPause:", videoPause); - return (
{["audio", "application"].indexOf(mediaType) !== -1 && diff --git a/src/renderer/component/video/view.jsx b/src/renderer/component/video/view.jsx index cb474ea72..355f13dc8 100644 --- a/src/renderer/component/video/view.jsx +++ b/src/renderer/component/video/view.jsx @@ -8,19 +8,11 @@ import NsfwOverlay from "component/nsfwOverlay"; class Video extends React.PureComponent { constructor(props) { super(props); - // console.log("video view props", props); this.state = { showNsfwHelp: false, - // videoPause: false, }; } - componentWillReceiveProps(nextProps) { - console.log("VIDEO COMPONENT WILL RECIEVE NEXTPROPS:", nextProps); - // this.setState({videoPause: nextProps.videoPause}); - // this.refs.media.children[0].pause(); - } - componentWillUnmount() { this.props.cancelPlay(); } @@ -65,9 +57,15 @@ class Video extends React.PureComponent { volume, uri, videoPause, + // setVideoPause, } = this.props; - console.log("VIDEO VIEW videoPause:", videoPause); + // console.log("setVideoPause", setVideoPause); + + const confirmVideoPause = val => { + console.log("this.props.setVideoPause:", this.props.setVideoPause); + this.props.setVideoPause(val); + }; const isPlaying = playingUri === uri; const isReadyToPlay = fileInfo && fileInfo.written_bytes > 0; @@ -103,38 +101,37 @@ class Video extends React.PureComponent { const poster = metadata.thumbnail; return ( -
-

videoPause: {videoPause}

-
- {isPlaying && - (!isReadyToPlay ? ( - - ) : ( - - ))} - {!isPlaying && ( -
- -
- )} - {this.state.showNsfwHelp && } -
+
+ {isPlaying && + (!isReadyToPlay ? ( + + ) : ( + + ))} + {!isPlaying && ( +
+ +
+ )} + {this.state.showNsfwHelp && }
); } diff --git a/src/renderer/redux/selectors/video.js b/src/renderer/redux/selectors/video.js index e79bf8765..65bf1290f 100644 --- a/src/renderer/redux/selectors/video.js +++ b/src/renderer/redux/selectors/video.js @@ -1,7 +1,7 @@ import * as settings from "constants/settings"; import { createSelector } from "reselect"; -const _selectState = state => state.video.videoPause || {}; +const _selectState = state => state.video || {}; export const selectVideoPause = createSelector(_selectState, state => { console.log("VIDEO PAUSE SELECTOR", state); From 6cfe724f55b19d86ff2e359fc630688344381a13 Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Tue, 19 Dec 2017 13:44:48 -0500 Subject: [PATCH 18/19] update discord username jigglytom > jiggytom --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 10d01b548..9f8c64645 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,7 +48,7 @@ Lastly, don't feel limited by this list. Should LBRY have built-in Tor support? Name | Role | Discord | Email --- | --- | --- | --- [Liam](https://github.com/liamcardenas) | The application engineer in charge of community development. He is the person to contact with any development/contribution related questions. | liamsdouble | liam@lbry.io -[Tom](https://github.com/tzarebczan) | Community manager. He knows more than anyone about the app and all of its flaws. Reach out to him with any questions about how the app works, if a bug has been reported, or if a feature should be requested. | jigglytom | tom@lbry.io +[Tom](https://github.com/tzarebczan) | Community manager. He knows more than anyone about the app and all of its flaws. Reach out to him with any questions about how the app works, if a bug has been reported, or if a feature should be requested. | jiggytom | tom@lbry.io [Sean](https://github.com/seanyesmunt) | An application engineer who focuses largely on UI/UX. If you have a design or implementation question, feel free to reach out to him. | sean | sean@lbry.io Join our discord [here](https://chat.lbry.io/). From 7ccf6c0a92b23fe6ff7198eb4754edd68c36d447 Mon Sep 17 00:00:00 2001 From: Travis Eden Date: Tue, 19 Dec 2017 14:41:00 -0500 Subject: [PATCH 19/19] feature complete --- src/renderer/component/video/index.js | 1 + .../component/video/internal/player.jsx | 3 +-- src/renderer/component/video/view.jsx | 11 ++--------- src/renderer/constants/action_types.js | 2 -- src/renderer/redux/actions/video.js | 18 ++---------------- src/renderer/redux/reducers/video.js | 6 +----- src/renderer/redux/selectors/video.js | 8 ++++---- 7 files changed, 11 insertions(+), 38 deletions(-) diff --git a/src/renderer/component/video/index.js b/src/renderer/component/video/index.js index 04c223f61..f0a1a43f1 100644 --- a/src/renderer/component/video/index.js +++ b/src/renderer/component/video/index.js @@ -3,6 +3,7 @@ import { connect } from "react-redux"; import { doChangeVolume } from "redux/actions/app"; import { selectVolume } from "redux/selectors/app"; import { doPlayUri, doSetPlayingUri } from "redux/actions/content"; +import { setVideoPause } from "redux/actions/video"; import { makeSelectMetadataForUri, makeSelectContentTypeForUri, diff --git a/src/renderer/component/video/internal/player.jsx b/src/renderer/component/video/internal/player.jsx index 42b9b4bf2..e993dac36 100644 --- a/src/renderer/component/video/internal/player.jsx +++ b/src/renderer/component/video/internal/player.jsx @@ -4,7 +4,6 @@ import { Thumbnail } from "component/common"; import player from "render-media"; import fs from "fs"; import LoadingScreen from "./loading-screen"; -import { setVideoPause } from "../../../redux/actions/video"; class VideoPlayer extends React.PureComponent { static MP3_CONTENT_TYPES = ["audio/mpeg3", "audio/mpeg"]; @@ -24,7 +23,7 @@ class VideoPlayer extends React.PureComponent { componentWillReceiveProps(nextProps) { if (nextProps.videoPause) { this.refs.media.children[0].pause(); - this.props.confirmVideoPause(false); + this.props.setVideoPause(false); } } diff --git a/src/renderer/component/video/view.jsx b/src/renderer/component/video/view.jsx index 355f13dc8..c5c4d8d88 100644 --- a/src/renderer/component/video/view.jsx +++ b/src/renderer/component/video/view.jsx @@ -57,16 +57,9 @@ class Video extends React.PureComponent { volume, uri, videoPause, - // setVideoPause, + setVideoPause, } = this.props; - // console.log("setVideoPause", setVideoPause); - - const confirmVideoPause = val => { - console.log("this.props.setVideoPause:", this.props.setVideoPause); - this.props.setVideoPause(val); - }; - const isPlaying = playingUri === uri; const isReadyToPlay = fileInfo && fileInfo.written_bytes > 0; const obscureNsfw = this.props.obscureNsfw && metadata && metadata.nsfw; @@ -120,7 +113,7 @@ class Video extends React.PureComponent { changeVolume={changeVolume} volume={volume} videoPause={videoPause} - confirmVideoPause={confirmVideoPause} + setVideoPause={setVideoPause} /> ))} {!isPlaying && ( diff --git a/src/renderer/constants/action_types.js b/src/renderer/constants/action_types.js index d83cf10ed..bbf6c520b 100644 --- a/src/renderer/constants/action_types.js +++ b/src/renderer/constants/action_types.js @@ -166,6 +166,4 @@ export const CHANNEL_UNSUBSCRIBE = "CHANNEL_UNSUBSCRIBE"; export const HAS_FETCHED_SUBSCRIPTIONS = "HAS_FETCHED_SUBSCRIPTIONS"; // Video controls -export const VIDEO_PAUSE_STARTED = "VIDEO_PAUSE_STARTED"; -export const VIDEO_PAUSE_COMPLETED = "VIDEO_PAUSE_COMPLETED"; export const SET_VIDEO_PAUSE = "SET_VIDEO_PAUSE"; diff --git a/src/renderer/redux/actions/video.js b/src/renderer/redux/actions/video.js index c4c8ec40a..bf88d2d26 100644 --- a/src/renderer/redux/actions/video.js +++ b/src/renderer/redux/actions/video.js @@ -3,22 +3,8 @@ import * as actions from "constants/action_types"; import type { Action, Dispatch } from "redux/reducers/video"; import lbry from "lbry"; -// export const doVideoPause = ( -// dispatch: Dispatch -// ) => { -// console.log("diVideoPause helllllo"); -// console.log(dispatch); -// return dispatch({type: actions.VIDEO_PAUSE_STARTED}); -// } - -// export const confirmVideoPause = ( -// dispatch: Dispatch -// ) => dispatch({type: actions.VIDEO_PAUSE_COMPLETED}); - -export const setVideoPause = (data: boolean) => (dispatch: Dispatch) => { - console.log("VIDEO ACTION data:", data); - return dispatch({ +export const setVideoPause = (data: boolean) => (dispatch: Dispatch) => + dispatch({ type: actions.SET_VIDEO_PAUSE, data, }); -}; diff --git a/src/renderer/redux/reducers/video.js b/src/renderer/redux/reducers/video.js index 6aafaa9ec..0f18844dd 100644 --- a/src/renderer/redux/reducers/video.js +++ b/src/renderer/redux/reducers/video.js @@ -19,11 +19,7 @@ export default handleActions( [actions.SET_VIDEO_PAUSE]: ( state: VideoState, action: setVideoPause - ): VideoState => { - console.log("VIDEO REDUCER STATE", state); - console.log("VIDEO REDUCER ACTION", action); - return { ...state, videoPause: action.data }; - }, + ): VideoState => ({ ...state, videoPause: action.data }), }, defaultState ); diff --git a/src/renderer/redux/selectors/video.js b/src/renderer/redux/selectors/video.js index 65bf1290f..a41c95803 100644 --- a/src/renderer/redux/selectors/video.js +++ b/src/renderer/redux/selectors/video.js @@ -3,7 +3,7 @@ import { createSelector } from "reselect"; const _selectState = state => state.video || {}; -export const selectVideoPause = createSelector(_selectState, state => { - console.log("VIDEO PAUSE SELECTOR", state); - return state.videoPause; -}); +export const selectVideoPause = createSelector( + _selectState, + state => state.videoPause +);