Merge master branch's changes

This commit is contained in:
Igor Gassmann 2017-11-21 16:51:12 -03:00
commit 96d70feb7d
128 changed files with 726 additions and 588 deletions

View file

@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.18.0rc2
current_version = 0.18.2
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)((?P<release>[a-z]+)(?P<candidate>\d+))?

View file

@ -8,23 +8,17 @@ Web UI version numbers should always match the corresponding version of LBRY App
## [Unreleased]
### Added
* Trending! The landing page of the app now features content that is surging in popularity relative to past interest.
* The app now closes to the system tray. This will help improve publish seeding and network performance. Directing the app to quit or exit will close it entirely. (#374)
* You can now revoke past publishes to receive your credits. (#581)
* You can now unlock tips sent to you so you can send them elsewhere or spend them. (#581)
* Added new window menu options for reloading and help.
* Rewards are now marked in transaction history (#660)
*
*
### Changed
* Daemon updated to [v0.18.0](https://github.com/lbryio/lbry/releases/tag/v0.18.0). The largest changes here are several more network improvements and fixes as well as functionality and improvements related to concurrent heavier usage (bugs and issues largely discoverd by spee.ch).
* Replaced all instances of `XMLHttpRequest` with native `Fetch` API (#676).
* Moved all redux code into /redux folder
*
### Fixed
* Fixed console errors on settings page related to improper React input properties.
* Fixed modals being too narrow after font change (#709)
* Fixed bug that prevented new channel and first publish rewards from being claimed (#290)
* Long channel names causing inconsistent thumbnail sizes (#721)
* Fixed regression in #697 causing transaction screen to not load for new users (#755)
* Fixed scriolling restore/reset/set (#729)
### Deprecated
*
@ -34,6 +28,37 @@ Web UI version numbers should always match the corresponding version of LBRY App
*
*
## [0.18.2] - 2017-11-15
### Fixed
* Email verification is fixed. (#746)
## [0.18.0] - 2017-11-13
### Added
* Trending! The landing page of the app now features content that is surging in popularity relative to past interest.
* The app now closes to the system tray. This will help improve publish seeding and network performance. Directing the app to quit or exit will close it entirely. (#374)
* You can now revoke past publishes to receive your credits. (#581)
* You can now unlock tips sent to you so you can send them elsewhere or spend them. (#581)
* Added new window menu options for reloading and help.
* Rewards are now marked in transaction history (#660)
### Changed
* Daemon updated to [v0.18.0](https://github.com/lbryio/lbry/releases/tag/v0.18.0). The largest changes here are several more network improvements and fixes as well as functionality and improvements related to concurrent heavier usage (bugs and issues largely discoverd by spee.ch).
* Improved build and first-run process for new developers.
* Replaced all instances of `XMLHttpRequest` with native `Fetch` API (#676).
### Fixed
* Fixed console errors on settings page related to improper React input properties.
* Fixed modals being too narrow after font change (#709)
* Fixed bug that prevented new channel and first publish rewards from being claimed (#290)
## [0.17.1] - 2017-10-25
### Changed

View file

@ -18,16 +18,14 @@ Our [releases page](https://github.com/lbryio/lbry-app/releases/latest) also con
To install from source or make changes to the application, continue reading below.
## Development
## Development on Linux and macOS
### One-time Setup
1. Install npm and node (v6 and above required, use [nvm](https://github.com/creationix/nvm/blob/master/README.md) if having trouble)
2. Install keytar and libsecret (see [keytar repository](https://github.com/atom/node-keytar) )
3. Install yarn by running: npm install -g yarn (may require elevated permissions)
4. Check out this repo.
5. Set up a Python virtual environment, or live on the wild side.
6. Run `./build.sh`. This builds the UI assets and puts them into `app/dist`. It also downloads [lbry daemon](https://github.com/lbryio/lbry/releases).
1. Clone this repo
2. `DEPS=true ./build.sh`
This will download and install the LBRY app and its dependencies, including [the LBRY daemon](https://github.com/lbryio/lbry) and command line utilities like `node` and `yarn`. The LBRY app requires Node >= 6; if you have an earlier version of Node installed and want to keep it, you can use [nvm](https://github.com/creationix/nvm) to switch back and forth.
### Running

View file

@ -226,7 +226,15 @@ function createWindow () {
function createTray () {
// Minimize to tray logic follows:
// Set the tray icon
const iconPath = path.join(app.getAppPath(), "/dist/img/fav/32x32.png");
let iconPath;
if (process.platform === 'darwin') {
// Using @2x for mac retina screens so the icon isn't blurry
// file name needs to include "Template" at the end for dark menu bar
iconPath = path.join(app.getAppPath(), "/dist/img/fav/macTemplate@2x.png");
} else {
iconPath = path.join(app.getAppPath(), "/dist/img/fav/32x32.png");
}
tray = new Tray(iconPath);
tray.setToolTip("LBRY App");
tray.setTitle("LBRY");

View file

@ -1,8 +1,9 @@
{
"name": "LBRY",
"version": "0.18.0rc2",
"version": "0.18.2",
"main": "main.js",
"description": "A browser for the LBRY network, a digital marketplace controlled by its users.",
"homepage": "https://github.com/lbryio/lbry-app",
"author": {
"name": "LBRY Inc.",
"email": "hello@lbry.io"

View file

@ -1,4 +1,4 @@
#!/bin/bash
# this is here because teamcity runs /build.sh to build the project
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
$DIR/build/build.sh
"$DIR/build/build.sh"

View file

@ -23,7 +23,7 @@ cd ui
yarn install
npm rebuild node-sass
node_modules\.bin\node-sass --output dist\css --sourcemap=none scss\
node_modules\.bin\webpack
node_modules\.bin\webpack --config webpack.prod.js
Copy-Item dist ..\app\ -recurse
cd ..

View file

@ -29,25 +29,14 @@ FULL_BUILD="${FULL_BUILD:-false}"
if [ -n "${TEAMCITY_VERSION:-}" -o -n "${APPVEYOR:-}" ]; then
FULL_BUILD="true"
fi
if [ "$FULL_BUILD" != "true" ]; then
echo -e "\033[1;36mDependencies will NOT be installed. Run with 'FULL_BUILD=true' to install dependencies.\x1b[m"
fi
if [ "$FULL_BUILD" == "true" ]; then
DEPS="${DEPS:-$FULL_BUILD}"
if [ "$DEPS" != "true" ]; then
echo -e "\033[1;36mDependencies will NOT be installed. Run with \"INSTALL_DEPENDENCIES=true\" to install dependencies, or \"FULL_BUILD=true\" to install dependencies and build a complete app.\x1b[m"
else
# install dependencies
echo -e "\033[0;32mInstalling Dependencies\x1b[m"
$BUILD_DIR/prebuild.sh
VENV="$BUILD_DIR/venv"
if [ -d "$VENV" ]; then
rm -rf "$VENV"
fi
virtualenv "$VENV"
set +u
source "$VENV/bin/activate"
set -u
pip install -r "$BUILD_DIR/requirements.txt"
python "$BUILD_DIR/set_version.py"
"$BUILD_DIR/install_deps.sh"
fi
[ -d "$ROOT/dist" ] && rm -rf "$ROOT/dist"
@ -90,7 +79,7 @@ DAEMON_URL=$(echo ${DAEMON_URL_TEMPLATE//DAEMONVER/$DAEMON_VER} | sed "s/OSNAME/
DAEMON_VER_PATH="$BUILD_DIR/daemon.ver"
echo "$DAEMON_VER_PATH"
if [[ ! -f $DAEMON_VER_PATH || ! -f $ROOT/app/dist/lbrynet-daemon || "$(< "$DAEMON_VER_PATH")" != "$DAEMON_VER" ]]; then
wget --quiet "$DAEMON_URL" -O "$BUILD_DIR/daemon.zip"
curl -sL -o "$BUILD_DIR/daemon.zip" "$DAEMON_URL"
unzip "$BUILD_DIR/daemon.zip" -d "$ROOT/app/dist/"
rm "$BUILD_DIR/daemon.zip"
echo "$DAEMON_VER" > "$DAEMON_VER_PATH"
@ -134,9 +123,13 @@ if [ "$FULL_BUILD" == "true" ]; then
# electron-build has a publish feature, but I had a hard time getting
# it to reliably work and it also seemed difficult to configure. Not proud of
# this, but it seemed better to write my own.
python "$BUILD_DIR/upload_assets.py"
deactivate
VENV="$BUILD_DIR/venv"
if [ -d "$VENV" ]; then
rm -rf "$VENV"
fi
virtualenv "$VENV"
"$VENV/bin/pip" install -r "$BUILD_DIR/requirements.txt"
"$VENV/bin/python" "$BUILD_DIR/upload_assets.py"
echo -e '\033[0;32mBuild and packaging complete.\x1b[m'
else

View file

@ -1,8 +1,6 @@
#!/bin/bash
set -euo pipefail
set -x
LINUX=false
OSX=false
@ -18,7 +16,7 @@ fi
SUDO=''
if $LINUX && (( $EUID != 0 )); then
if (( $EUID != 0 )); then
SUDO='sudo'
fi
@ -41,7 +39,7 @@ set -eu
if $LINUX; then
INSTALL="$SUDO apt-get install --no-install-recommends -y"
$INSTALL build-essential libssl-dev libffi-dev libgmp3-dev python2.7-dev libsecret-1-dev wget
$INSTALL build-essential libssl-dev libffi-dev libgmp3-dev python2.7-dev libsecret-1-dev curl
elif $OSX && ! cmd_exists brew ; then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
@ -52,6 +50,9 @@ if ! cmd_exists python; then
$INSTALL python2.7
elif $OSX; then
brew install python
else
echo "python2.7 required"
exit 1
fi
fi
@ -64,11 +65,13 @@ fi
if ! cmd_exists pip; then
if $LINUX; then
$INSTALL python-pip
$SUDO pip install --upgrade pip
elif $OSX; then
$SUDO easy_install pip
else
echo "Pip required"
echo "pip required"
exit 1
fi
$SUDO pip install --upgrade pip
fi
if $LINUX && [ "$(pip list --format=columns | grep setuptools | wc -l)" -ge 1 ]; then
@ -85,6 +88,9 @@ if ! cmd_exists node; then
$INSTALL nodejs
elif $OSX; then
brew install node
else
echo "node required"
exit 1
fi
fi
@ -96,16 +102,17 @@ if ! cmd_exists yarn; then
$SUDO apt-get install yarn
elif $OSX; then
brew install yarn
else
echo "yarn required"
exit 1
fi
fi
if ! cmd_exists unzip; then
if $LINUX; then
$INSTALL unzip
elif $OSX; then
else
echo "unzip required"
exit 1
# not sure this works, but OSX should come with unzip
# brew install unzip
fi
fi

View file

@ -1,21 +0,0 @@
"""Set the package version to the output of `git describe`"""
from __future__ import print_function
import os.path
import sys
import fileinput
def main():
filename = os.path.abspath(
os.path.join(os.path.abspath(__file__), '..', '..', 'ui', 'js', 'lbryio.js'))
for line in fileinput.input(filename, inplace=True):
if line.startswith(' enabled: false'):
print(' enabled: true')
else:
print(line, end='')
if __name__ == '__main__':
sys.exit(main())

BIN
ui/dist/img/fav/macTemplate@2x.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -1,14 +1,20 @@
import React from "react";
import { connect } from "react-redux";
import { selectPageTitle } from "selectors/navigation";
import { selectUser } from "selectors/user";
import { doAlertError } from "actions/app";
import { doRecordScroll } from "actions/navigation";
import {
selectPageTitle,
selectHistoryIndex,
selectActiveHistoryEntry,
} from "redux/selectors/navigation";
import { selectUser } from "redux/selectors/user";
import { doAlertError } from "redux/actions/app";
import { doRecordScroll } from "redux/actions/navigation";
import App from "./view";
const select = (state, props) => ({
pageTitle: selectPageTitle(state),
user: selectUser(state),
currentStackIndex: selectHistoryIndex(state),
currentPageAttributes: selectActiveHistoryEntry(state),
});
const perform = dispatch => ({

View file

@ -4,30 +4,49 @@ import Header from "component/header";
import Theme from "component/theme";
import ModalRouter from "modal/modalRouter";
import lbry from "lbry";
import throttle from "util/throttle";
class App extends React.PureComponent {
constructor() {
super();
this.mainContent = undefined;
}
componentWillMount() {
const { alertError } = this.props;
document.addEventListener("unhandledError", event => {
alertError(event.detail);
});
}
this.scrollListener = () => this.props.recordScroll(window.scrollY);
componentDidMount() {
const { recordScroll } = this.props;
const mainContent = document.getElementById("main-content");
this.mainContent = mainContent;
window.addEventListener("scroll", this.scrollListener);
const scrollListener = () => recordScroll(this.mainContent.scrollTop);
this.setTitleFromProps(this.props);
this.mainContent.addEventListener("scroll", throttle(scrollListener, 750));
}
componentWillUnmount() {
window.removeEventListener("scroll", this.scrollListener);
this.mainContent.removeEventListener("scroll", this.scrollListener);
}
componentWillReceiveProps(props) {
this.setTitleFromProps(props);
}
componentDidUpdate(prevProps) {
const { currentStackIndex: prevStackIndex } = prevProps;
const { currentStackIndex, currentPageAttributes } = this.props;
if (currentStackIndex !== prevStackIndex) {
this.mainContent.scrollTop = currentPageAttributes.scrollY || 0;
}
}
setTitleFromProps(props) {
window.document.title = props.pageTitle || "LBRY";
}

View file

@ -1,6 +1,6 @@
import React from "react";
import { connect } from "react-redux";
import { selectUserEmail } from "selectors/user";
import { selectUserEmail } from "redux/selectors/user";
import CardVerify from "./view";
const select = state => ({

View file

@ -1,10 +1,10 @@
import React from "react";
import { connect } from "react-redux";
import { makeSelectClaimForUri } from "selectors/claims";
import { doNavigate } from "actions/navigation";
import { doResolveUri } from "actions/content";
import { makeSelectTotalItemsForChannel } from "selectors/content";
import { makeSelectIsUriResolving } from "selectors/content";
import { makeSelectClaimForUri } from "redux/selectors/claims";
import { doNavigate } from "redux/actions/navigation";
import { doResolveUri } from "redux/actions/content";
import { makeSelectTotalItemsForChannel } from "redux/selectors/content";
import { makeSelectIsUriResolving } from "redux/selectors/content";
import ChannelTile from "./view";
const select = (state, props) => ({

View file

@ -1,13 +1,14 @@
import React from "react";
import { connect } from "react-redux";
import { makeSelectBlockDate } from "selectors/wallet";
import { doFetchBlock } from "actions/wallet";
import { makeSelectBlockDate } from "redux/selectors/wallet";
import { doFetchBlock } from "redux/actions/wallet";
import DateTime from "./view";
const select = (state, props) => ({
date: !props.date && props.block
? makeSelectBlockDate(props.block)(state)
: props.date,
date:
!props.date && props.block
? makeSelectBlockDate(props.block)(state)
: props.date,
});
const perform = dispatch => ({

View file

@ -1,9 +1,9 @@
import React from "react";
import { connect } from "react-redux";
import { makeSelectFileInfoForUri } from "selectors/file_info";
import { makeSelectCostInfoForUri } from "selectors/cost_info";
import { doOpenModal } from "actions/app";
import { makeSelectClaimIsMine } from "selectors/claims";
import { makeSelectFileInfoForUri } from "redux/selectors/file_info";
import { makeSelectCostInfoForUri } from "redux/selectors/cost_info";
import { doOpenModal } from "redux/actions/app";
import { makeSelectClaimIsMine } from "redux/selectors/claims";
import FileActions from "./view";
const select = (state, props) => ({

View file

@ -1,17 +1,17 @@
import React from "react";
import { connect } from "react-redux";
import { doNavigate } from "actions/navigation";
import { doResolveUri } from "actions/content";
import { selectShowNsfw } from "selectors/settings";
import { doNavigate } from "redux/actions/navigation";
import { doResolveUri } from "redux/actions/content";
import { selectShowNsfw } from "redux/selectors/settings";
import {
makeSelectClaimForUri,
makeSelectMetadataForUri,
} from "selectors/claims";
import { makeSelectFileInfoForUri } from "selectors/file_info";
} from "redux/selectors/claims";
import { makeSelectFileInfoForUri } from "redux/selectors/file_info";
import {
makeSelectIsUriResolving,
selectRewardContentClaimIds,
} from "selectors/content";
} from "redux/selectors/content";
import FileCard from "./view";
const select = (state, props) => ({

View file

@ -4,10 +4,10 @@ import {
makeSelectClaimForUri,
makeSelectContentTypeForUri,
makeSelectMetadataForUri,
} from "selectors/claims";
} from "redux/selectors/claims";
import FileDetails from "./view";
import { doOpenFileInFolder } from "actions/file_info";
import { makeSelectFileInfoForUri } from "selectors/file_info";
import { doOpenFileInFolder } from "redux/actions/file_info";
import { makeSelectFileInfoForUri } from "redux/selectors/file_info";
const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),

View file

@ -4,11 +4,11 @@ import {
makeSelectFileInfoForUri,
makeSelectDownloadingForUri,
makeSelectLoadingForUri,
} from "selectors/file_info";
import { makeSelectCostInfoForUri } from "selectors/cost_info";
import { doFetchAvailability } from "actions/availability";
import { doOpenFileInShell } from "actions/file_info";
import { doPurchaseUri, doStartDownload } from "actions/content";
} from "redux/selectors/file_info";
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 FileDownloadLink from "./view";
const select = (state, props) => ({

View file

@ -1,7 +1,10 @@
import React from "react";
import { connect } from "react-redux";
import { doSearch } from "actions/search";
import { selectIsSearching, makeSelectSearchUris } from "selectors/search";
import { doSearch } from "redux/actions/search";
import {
selectIsSearching,
makeSelectSearchUris,
} from "redux/selectors/search";
import FileListSearch from "./view";
const select = (state, props) => ({

View file

@ -1,11 +1,11 @@
import React from "react";
import { connect } from "react-redux";
import { doFetchCostInfoForUri } from "actions/cost_info";
import { doFetchCostInfoForUri } from "redux/actions/cost_info";
import {
makeSelectCostInfoForUri,
makeSelectFetchingCostInfoForUri,
} from "selectors/cost_info";
import { makeSelectClaimForUri } from "selectors/claims";
} from "redux/selectors/cost_info";
import { makeSelectClaimForUri } from "redux/selectors/claims";
import FilePrice from "./view";
const select = (state, props) => ({

View file

@ -1,17 +1,17 @@
import React from "react";
import { connect } from "react-redux";
import { doNavigate } from "actions/navigation";
import { doResolveUri } from "actions/content";
import { doNavigate } from "redux/actions/navigation";
import { doResolveUri } from "redux/actions/content";
import {
makeSelectClaimForUri,
makeSelectMetadataForUri,
} from "selectors/claims";
import { makeSelectFileInfoForUri } from "selectors/file_info";
import { selectShowNsfw } from "selectors/settings";
} from "redux/selectors/claims";
import { makeSelectFileInfoForUri } from "redux/selectors/file_info";
import { selectShowNsfw } from "redux/selectors/settings";
import {
makeSelectIsUriResolving,
selectRewardContentClaimIds,
} from "selectors/content";
} from "redux/selectors/content";
import FileTile from "./view";
const select = (state, props) => ({

View file

@ -4,13 +4,13 @@ import { connect } from "react-redux";
import {
selectIsBackDisabled,
selectIsForwardDisabled,
} from "selectors/navigation";
import { selectBalance } from "selectors/wallet";
} from "redux/selectors/navigation";
import { selectBalance } from "redux/selectors/wallet";
import {
doNavigate,
doHistoryBack,
doHistoryForward,
} from "actions/navigation";
} from "redux/actions/navigation";
import Header from "./view";
import { selectIsUpgradeAvailable } from "../../selectors/app";
import { doDownloadUpgrade } from "../../actions/app";

View file

@ -3,7 +3,7 @@ import { connect } from "react-redux";
import {
selectUserInvitees,
selectUserInviteStatusIsPending,
} from "selectors/user";
} from "redux/selectors/user";
import InviteList from "./view";
const select = state => ({

View file

@ -5,11 +5,11 @@ import {
selectUserInvitesRemaining,
selectUserInviteNewIsPending,
selectUserInviteNewErrorMessage,
} from "selectors/user";
} from "redux/selectors/user";
import rewards from "rewards";
import { makeSelectRewardAmountByType } from "selectors/rewards";
import { makeSelectRewardAmountByType } from "redux/selectors/rewards";
import { doUserInviteNew } from "actions/user";
import { doUserInviteNew } from "redux/actions/user";
const select = state => {
const selectReward = makeSelectRewardAmountByType();

View file

@ -1,6 +1,6 @@
import React from "react";
import { connect } from "react-redux";
import { doNavigate } from "actions/navigation";
import { doNavigate } from "redux/actions/navigation";
import Link from "./view";
const perform = dispatch => ({

View file

@ -1,6 +1,6 @@
import React from "react";
import { connect } from "react-redux";
import { doNavigate } from "actions/navigation";
import { doNavigate } from "redux/actions/navigation";
import NsfwOverlay from "./view";
const perform = dispatch => ({

View file

@ -340,9 +340,10 @@ class PublishForm extends React.PureComponent {
handleFeePrefChange(feeEnabled) {
this.setState({
isFee: feeEnabled,
feeAmount: this.state.feeAmount == ""
? this._defaultPaidPrice
: this.state.feeAmount,
feeAmount:
this.state.feeAmount == ""
? this._defaultPaidPrice
: this.state.feeAmount,
});
}
@ -556,82 +557,82 @@ class PublishForm extends React.PureComponent {
}
/>
</div>
{!this.state.hasFile && !this.myClaimExists()
? null
: <div>
<div className="card__content">
<FormRow
ref="meta_title"
label={__("Title")}
type="text"
name="title"
value={this.state.meta_title}
placeholder="Titular Title"
onChange={event => {
this.handleMetadataChange(event);
}}
/>
</div>
<div className="card__content">
<FormRow
type="text"
label={__("Thumbnail URL")}
name="thumbnail"
value={this.state.meta_thumbnail}
placeholder="http://spee.ch/mylogo"
onChange={event => {
this.handleMetadataChange(event);
}}
/>
</div>
<div className="card__content">
<FormRow
type="SimpleMDE"
label={__("Description")}
ref="meta_description"
name="description"
value={this.state.meta_description}
placeholder={__("Description of your content")}
onChange={text => {
this.handleDescriptionChanged(text);
}}
/>
</div>
<div className="card__content">
<FormRow
label={__("Language")}
type="select"
value={this.state.meta_language}
name="language"
onChange={event => {
this.handleMetadataChange(event);
}}
>
<option value="en">{__("English")}</option>
<option value="zh">{__("Chinese")}</option>
<option value="fr">{__("French")}</option>
<option value="de">{__("German")}</option>
<option value="jp">{__("Japanese")}</option>
<option value="ru">{__("Russian")}</option>
<option value="es">{__("Spanish")}</option>
</FormRow>
</div>
<div className="card__content">
<FormRow
type="select"
label={__("Maturity")}
value={this.state.meta_nsfw}
name="nsfw"
onChange={event => {
this.handleMetadataChange(event);
}}
>
{/* <option value=""></option> */}
<option value="0">{__("All Ages")}</option>
<option value="1">{__("Adults Only")}</option>
</FormRow>
</div>
</div>}
{!this.state.hasFile && !this.myClaimExists() ? null : (
<div>
<div className="card__content">
<FormRow
ref="meta_title"
label={__("Title")}
type="text"
name="title"
value={this.state.meta_title}
placeholder="Titular Title"
onChange={event => {
this.handleMetadataChange(event);
}}
/>
</div>
<div className="card__content">
<FormRow
type="text"
label={__("Thumbnail URL")}
name="thumbnail"
value={this.state.meta_thumbnail}
placeholder="http://spee.ch/mylogo"
onChange={event => {
this.handleMetadataChange(event);
}}
/>
</div>
<div className="card__content">
<FormRow
type="SimpleMDE"
label={__("Description")}
ref="meta_description"
name="description"
value={this.state.meta_description}
placeholder={__("Description of your content")}
onChange={text => {
this.handleDescriptionChanged(text);
}}
/>
</div>
<div className="card__content">
<FormRow
label={__("Language")}
type="select"
value={this.state.meta_language}
name="language"
onChange={event => {
this.handleMetadataChange(event);
}}
>
<option value="en">{__("English")}</option>
<option value="zh">{__("Chinese")}</option>
<option value="fr">{__("French")}</option>
<option value="de">{__("German")}</option>
<option value="jp">{__("Japanese")}</option>
<option value="ru">{__("Russian")}</option>
<option value="es">{__("Spanish")}</option>
</FormRow>
</div>
<div className="card__content">
<FormRow
type="select"
label={__("Maturity")}
value={this.state.meta_nsfw}
name="nsfw"
onChange={event => {
this.handleMetadataChange(event);
}}
>
{/* <option value=""></option> */}
<option value="0">{__("All Ages")}</option>
<option value="1">{__("Adults Only")}</option>
</FormRow>
</div>
</div>
)}
</section>
<section className="card">
@ -661,17 +662,21 @@ class PublishForm extends React.PureComponent {
<span className={!this.state.isFee ? "hidden" : ""}>
<FormFieldPrice
min="0"
defaultValue={{ amount: 5.0, currency: "LBC" }}
defaultValue={{
amount: this._defaultPaidPrice,
currency: "LBC",
}}
onChange={val => this.handleFeeChange(val)}
/>
</span>
{this.state.isFee && this.state.feeCurrency.toUpperCase() != "LBC"
? <div className="form-field__helper">
{__(
"All content fees are charged in LBC. For non-LBC payment methods, the number of credits charged will be adjusted based on the value of LBRY credits at the time of purchase."
)}
</div>
: null}
{this.state.isFee &&
this.state.feeCurrency.toUpperCase() != "LBC" ? (
<div className="form-field__helper">
{__(
"All content fees are charged in LBC. For non-LBC payment methods, the number of credits charged will be adjusted based on the value of LBRY credits at the time of purchase."
)}
</div>
) : null}
</div>
</section>
<section className="card">
@ -737,49 +742,45 @@ class PublishForm extends React.PureComponent {
"Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International"
)}
</option>
<option value="copyright">
{__("Copyrighted...")}
</option>
<option value="other">
{__("Other...")}
</option>
<option value="copyright">{__("Copyrighted...")}</option>
<option value="other">{__("Other...")}</option>
</FormRow>
{this.state.licenseType == "copyright"
? <FormRow
label={__("Copyright notice")}
type="text"
name="copyright-notice"
value={this.state.copyrightNotice}
onChange={event => {
this.handleCopyrightNoticeChange(event);
}}
/>
: null}
{this.state.licenseType == "copyright" ? (
<FormRow
label={__("Copyright notice")}
type="text"
name="copyright-notice"
value={this.state.copyrightNotice}
onChange={event => {
this.handleCopyrightNoticeChange(event);
}}
/>
) : null}
{this.state.licenseType == "other"
? <FormRow
label={__("License description")}
type="text"
name="other-license-description"
value={this.state.otherLicenseDescription}
onChange={event => {
this.handleOtherLicenseDescriptionChange(event);
}}
/>
: null}
{this.state.licenseType == "other" ? (
<FormRow
label={__("License description")}
type="text"
name="other-license-description"
value={this.state.otherLicenseDescription}
onChange={event => {
this.handleOtherLicenseDescriptionChange(event);
}}
/>
) : null}
{this.state.licenseType == "other"
? <FormRow
label={__("License URL")}
type="text"
name="other-license-url"
value={this.state.otherLicenseUrl}
onChange={event => {
this.handleOtherLicenseUrlChange(event);
}}
/>
: null}
{this.state.licenseType == "other" ? (
<FormRow
label={__("License URL")}
type="text"
name="other-license-url"
value={this.state.otherLicenseUrl}
onChange={event => {
this.handleOtherLicenseUrlChange(event);
}}
/>
) : null}
</div>
</section>
@ -795,8 +796,7 @@ class PublishForm extends React.PureComponent {
<div className="card__subtitle">
{__(
"This is the exact address where people find your content (ex. lbry://myvideo)."
)}
{" "}
)}{" "}
<Link
label={__("Learn more")}
href="https://lbry.io/faq/naming"
@ -805,9 +805,11 @@ class PublishForm extends React.PureComponent {
</div>
<div className="card__content">
<FormRow
prefix={`lbry://${this.state.channel === "anonymous"
? ""
: `${this.state.channel}/`}`}
prefix={`lbry://${
this.state.channel === "anonymous"
? ""
: `${this.state.channel}/`
}`}
type="text"
ref="name"
placeholder="myname"
@ -818,24 +820,26 @@ class PublishForm extends React.PureComponent {
helper={this.getNameBidHelpText()}
/>
</div>
{this.state.rawName
? <div className="card__content">
<FormRow
ref="bid"
type="number"
step="any"
label={__("Deposit")}
postfix="LBC"
onChange={event => {
this.handleBidChange(event);
}}
value={this.state.bid}
placeholder={this.claim() ? this.topClaimValue() + 10 : 100}
helper={lbcInputHelp}
min="0"
/>
</div>
: ""}
{this.state.rawName ? (
<div className="card__content">
<FormRow
ref="bid"
type="number"
step="any"
label={__("Deposit")}
postfix="LBC"
onChange={event => {
this.handleBidChange(event);
}}
value={this.state.bid}
placeholder={this.claim() ? this.topClaimValue() + 10 : 100}
helper={lbcInputHelp}
min="0"
/>
</div>
) : (
""
)}
</section>
<section className="card">
@ -847,8 +851,7 @@ class PublishForm extends React.PureComponent {
ref="tosAgree"
label={
<span>
{__("I agree to the")}
{" "}
{__("I agree to the")}{" "}
<Link
href="https://www.lbry.io/termsofservice"
label={__("LBRY terms of service")}
@ -894,8 +897,8 @@ class PublishForm extends React.PureComponent {
}}
>
<p>
{__("Your file has been published to LBRY at the address")}
{" "}<code>{this.state.uri}</code>!
{__("Your file has been published to LBRY at the address")}{" "}
<code>{this.state.uri}</code>!
</p>
<p>
{__(

View file

@ -4,9 +4,12 @@ import {
makeSelectClaimRewardError,
makeSelectRewardByType,
makeSelectIsRewardClaimPending,
} from "selectors/rewards";
import { doNavigate } from "actions/navigation";
import { doClaimRewardType, doClaimRewardClearError } from "actions/rewards";
} from "redux/selectors/rewards";
import { doNavigate } from "redux/actions/navigation";
import {
doClaimRewardType,
doClaimRewardClearError,
} from "redux/actions/rewards";
import RewardLink from "./view";
const makeSelect = () => {

View file

@ -1,6 +1,6 @@
import React from "react";
import { connect } from "react-redux";
import { selectClaimedRewards } from "selectors/rewards";
import { selectClaimedRewards } from "redux/selectors/rewards";
import RewardListClaimed from "./view";
const select = state => ({

View file

@ -1,6 +1,6 @@
import React from "react";
import { connect } from "react-redux";
import { selectUnclaimedRewardValue } from "selectors/rewards";
import { selectUnclaimedRewardValue } from "redux/selectors/rewards";
import RewardSummary from "./view";
const select = state => ({

View file

@ -4,7 +4,7 @@ import Router from "./view.jsx";
import {
selectCurrentPage,
selectCurrentParams,
} from "selectors/navigation.js";
} from "redux/selectors/navigation.js";
const select = state => ({
params: selectCurrentParams(state),

View file

@ -1,7 +1,7 @@
import React from "react";
import { connect } from "react-redux";
import { doRemoveSnackBarSnack } from "actions/app";
import { selectSnackBarSnacks } from "selectors/app";
import { doRemoveSnackBarSnack } from "redux/actions/app";
import { selectSnackBarSnacks } from "redux/selectors/app";
import SnackBar from "./view";
const perform = dispatch => ({

View file

@ -1,8 +1,11 @@
import React from "react";
import { connect } from "react-redux";
import { selectCurrentModal, selectDaemonVersionMatched } from "selectors/app";
import { doCheckDaemonVersion } from "actions/app";
import {
selectCurrentModal,
selectDaemonVersionMatched,
} from "redux/selectors/app";
import { doCheckDaemonVersion } from "redux/actions/app";
import SplashScreen from "./view";
const select = state => {

View file

@ -1,7 +1,10 @@
import React from "react";
import { connect } from "react-redux";
import { selectCurrentPage, selectHeaderLinks } from "selectors/navigation";
import { doNavigate } from "actions/navigation";
import {
selectCurrentPage,
selectHeaderLinks,
} from "redux/selectors/navigation";
import { doNavigate } from "redux/actions/navigation";
import SubHeader from "./view";
const select = (state, props) => ({

View file

@ -1,6 +1,6 @@
import React from "react";
import { connect } from "react-redux";
import { selectThemePath } from "selectors/settings.js";
import { selectThemePath } from "redux/selectors/settings.js";
import Theme from "./view";
const select = state => ({

View file

@ -1,9 +1,9 @@
import React from "react";
import { connect } from "react-redux";
import { doNavigate } from "actions/navigation";
import { doOpenModal } from "actions/app";
import { selectClaimedRewardsByTransactionId } from "selectors/rewards";
import { selectAllMyClaimsByOutpoint } from "selectors/claims";
import { doNavigate } from "redux/actions/navigation";
import { doOpenModal } from "redux/actions/app";
import { selectClaimedRewardsByTransactionId } from "redux/selectors/rewards";
import { selectAllMyClaimsByOutpoint } from "redux/selectors/claims";
import TransactionList from "./view";
const select = state => ({

View file

@ -1,12 +1,12 @@
import React from "react";
import { connect } from "react-redux";
import { doFetchTransactions } from "actions/wallet";
import { doFetchTransactions } from "redux/actions/wallet";
import {
selectBalance,
selectRecentTransactions,
selectHasTransactions,
selectIsFetchingTransactions,
} from "selectors/wallet";
} from "redux/selectors/wallet";
import TransactionListRecent from "./view";

View file

@ -1,9 +1,9 @@
import React from "react";
import lbryuri from "lbryuri";
import { connect } from "react-redux";
import { doResolveUri } from "actions/content";
import { makeSelectIsUriResolving } from "selectors/content";
import { makeSelectClaimForUri } from "selectors/claims";
import { doResolveUri } from "redux/actions/content";
import { makeSelectIsUriResolving } from "redux/selectors/content";
import { makeSelectClaimForUri } from "redux/selectors/claims";
import UriIndicator from "./view";
const select = (state, props) => ({

View file

@ -60,13 +60,17 @@ class UriIndicator extends React.PureComponent {
const inner = (
<span>
{channelName} {" "}
{!signatureIsValid
? <Icon
icon={icon}
className={`channel-indicator__icon channel-indicator__icon--${modifier}`}
/>
: ""}
<span className="channel-name">{channelName}</span>{" "}
{!signatureIsValid ? (
<Icon
icon={icon}
className={`channel-indicator__icon channel-indicator__icon--${
modifier
}`}
/>
) : (
""
)}
</span>
);

View file

@ -1,10 +1,10 @@
import React from "react";
import { connect } from "react-redux";
import { doUserEmailNew, doUserInviteNew } from "actions/user";
import { doUserEmailNew, doUserInviteNew } from "redux/actions/user";
import {
selectEmailNewIsPending,
selectEmailNewErrorMessage,
} from "selectors/user";
} from "redux/selectors/user";
import UserEmailNew from "./view";
const select = state => ({

View file

@ -1,11 +1,11 @@
import React from "react";
import { connect } from "react-redux";
import { doUserEmailVerify } from "actions/user";
import { doUserEmailVerify } from "redux/actions/user";
import {
selectEmailVerifyIsPending,
selectEmailToVerify,
selectEmailVerifyErrorMessage,
} from "selectors/user";
} from "redux/selectors/user";
import UserEmailVerify from "./view";
const select = state => ({

View file

@ -1,13 +1,13 @@
import React from "react";
import { connect } from "react-redux";
import { doNavigate } from "actions/navigation";
import { doUserIdentityVerify } from "actions/user";
import { doNavigate } from "redux/actions/navigation";
import { doUserIdentityVerify } from "redux/actions/user";
import rewards from "rewards";
import { makeSelectRewardByType } from "selectors/rewards";
import { makeSelectRewardByType } from "redux/selectors/rewards";
import {
selectIdentityVerifyIsPending,
selectIdentityVerifyErrorMessage,
} from "selectors/user";
} from "redux/selectors/user";
import UserVerify from "./view";
const select = (state, props) => {

View file

@ -1,21 +1,21 @@
import React from "react";
import { connect } from "react-redux";
import { doChangeVolume } from "actions/app";
import { selectVolume } from "selectors/app";
import { doPlayUri, doSetPlayingUri } from "actions/content";
import { doChangeVolume } from "redux/actions/app";
import { selectVolume } from "redux/selectors/app";
import { doPlayUri, doSetPlayingUri } from "redux/actions/content";
import {
makeSelectMetadataForUri,
makeSelectContentTypeForUri,
} from "selectors/claims";
} from "redux/selectors/claims";
import {
makeSelectFileInfoForUri,
makeSelectLoadingForUri,
makeSelectDownloadingForUri,
} from "selectors/file_info";
import { makeSelectCostInfoForUri } from "selectors/cost_info";
import { selectShowNsfw } from "selectors/settings";
} from "redux/selectors/file_info";
import { makeSelectCostInfoForUri } from "redux/selectors/cost_info";
import { selectShowNsfw } from "redux/selectors/settings";
import Video from "./view";
import { selectPlayingUri } from "selectors/content";
import { selectPlayingUri } from "redux/selectors/content";
const select = (state, props) => ({
costInfo: makeSelectCostInfoForUri(props.uri)(state),

View file

@ -1,10 +1,10 @@
import React from "react";
import { connect } from "react-redux";
import { doCheckAddressIsMine, doGetNewAddress } from "actions/wallet";
import { doCheckAddressIsMine, doGetNewAddress } from "redux/actions/wallet";
import {
selectReceiveAddress,
selectGettingNewAddress,
} from "selectors/wallet";
} from "redux/selectors/wallet";
import WalletAddress from "./view";
const select = state => ({

View file

@ -1,6 +1,6 @@
import React from "react";
import { connect } from "react-redux";
import { selectBalance } from "selectors/wallet";
import { selectBalance } from "redux/selectors/wallet";
import WalletBalance from "./view";
const select = state => ({

View file

@ -4,12 +4,12 @@ import {
doSendDraftTransaction,
doSetDraftTransactionAmount,
doSetDraftTransactionAddress,
} from "actions/wallet";
} from "redux/actions/wallet";
import {
selectDraftTransactionAmount,
selectDraftTransactionAddress,
selectDraftTransactionError,
} from "selectors/wallet";
} from "redux/selectors/wallet";
import WalletSend from "./view";

View file

@ -1,9 +1,9 @@
import React from "react";
import { connect } from "react-redux";
import { doSendSupport } from "actions/wallet";
import { doSendSupport } from "redux/actions/wallet";
import WalletSendTip from "./view";
import { makeSelectTitleForUri } from "selectors/claims";
import { selectIsSendingSupport } from "selectors/wallet";
import { makeSelectTitleForUri } from "redux/selectors/claims";
import { selectIsSendingSupport } from "redux/selectors/wallet";
const select = (state, props) => ({
isPending: selectIsSendingSupport(state),

View file

@ -1,8 +1,11 @@
import React from "react";
import { connect } from "react-redux";
import lbryuri from "lbryuri.js";
import { selectWunderBarAddress, selectWunderBarIcon } from "selectors/search";
import { doNavigate } from "actions/navigation";
import {
selectWunderBarAddress,
selectWunderBarIcon,
} from "redux/selectors/search";
import { doNavigate } from "redux/actions/navigation";
import Wunderbar from "./view";
const select = state => ({

View file

@ -9,26 +9,30 @@ jsonrpc.call = function(
connectFailedCallback,
timeout
) {
function checkStatus(response) {
function checkAndParse(response) {
if (response.status >= 200 && response.status < 300) {
return response;
return response.json();
} else {
var error = new Error(response.statusText);
error.response = response;
throw error;
return response.json().then(json => {
let error;
if (json.error) {
error = new Error(json.error);
} else {
error = new Error("Protocol error with unknown response signature");
}
return Promise.reject(error);
});
}
}
function parseJSON(response) {
return response.json();
}
function makeRequest(url, options) {
return new Promise((resolve, reject) => {
fetch(url, options).then(resolve).catch(reject);
fetch(url, options)
.then(resolve)
.catch(reject);
if (timeout) {
const e = new Error(__("XMLHttpRequest connection timed out"));
const e = new Error(__("Protocol request timed out"));
setTimeout(() => {
return reject(e);
}, timeout);
@ -51,8 +55,7 @@ jsonrpc.call = function(
sessionStorage.setItem("JSONRPCCounter", counter + 1);
return fetch(url, options)
.then(checkStatus)
.then(parseJSON)
.then(checkAndParse)
.then(response => {
const error =
response.error || (response.result && response.result.error);

View file

@ -45,24 +45,25 @@ lbryio.call = function(resource, action, params = {}, method = "get") {
return Promise.reject(new Error(__("Invalid method")));
}
function checkStatus(response) {
function checkAndParse(response) {
if (response.status >= 200 && response.status < 300) {
return response;
return response.json();
} else {
var error = new Error(response.statusText);
error.response = response;
throw error;
return response.json().then(json => {
let error;
if (json.error) {
error = new Error(json.error);
} else {
error = new Error("Unknown API error signature");
}
error.response = response; //this is primarily a hack used in actions/user.js
return Promise.reject(error);
});
}
}
function parseJSON(response) {
return response.json();
}
function makeRequest(url, options) {
return fetch(url, options).then(checkStatus).then(parseJSON).catch(e => {
throw e;
});
return fetch(url, options).then(checkAndParse);
}
return lbryio.getAuthToken().then(token => {

View file

@ -5,9 +5,9 @@ import SnackBar from "component/snackBar";
import { Provider } from "react-redux";
import store from "store.js";
import SplashScreen from "component/splash";
import { doDaemonReady } from "actions/app";
import { doNavigate } from "actions/navigation";
import { doDownloadLanguages } from "actions/settings";
import { doDaemonReady } from "redux/actions/app";
import { doNavigate } from "redux/actions/navigation";
import { doDownloadLanguages } from "redux/actions/settings";
import * as types from "constants/action_types";
const env = ENV;
@ -71,7 +71,10 @@ var init = function() {
ReactDOM.render(
<Provider store={store}>
<div><App /><SnackBar /></div>
<div>
<App />
<SnackBar />
</div>
</Provider>,
canvas
);

View file

@ -1,8 +1,8 @@
import React from "react";
import { connect } from "react-redux";
import { doCloseModal } from "actions/app";
import { doLoadVideo, doSetPlayingUri } from "actions/content";
import { makeSelectMetadataForUri } from "selectors/claims";
import { doCloseModal } from "redux/actions/app";
import { doLoadVideo, doSetPlayingUri } from "redux/actions/content";
import { makeSelectMetadataForUri } from "redux/selectors/claims";
import ModalAffirmPurchase from "./view";
const select = (state, props) => ({

View file

@ -1,6 +1,6 @@
import React from "react";
import { connect } from "react-redux";
import { doCloseModal } from "actions/app";
import { doCloseModal } from "redux/actions/app";
import ModalAuthFailure from "./view";
const select = state => ({});

View file

@ -1,15 +1,15 @@
import React from "react";
import { connect } from "react-redux";
import { doCloseModal } from "actions/app";
import { doAuthNavigate } from "actions/navigation";
import { doSetClientSetting } from "actions/settings";
import { selectUserIsRewardApproved } from "selectors/user";
import { selectBalance } from "selectors/wallet";
import { doCloseModal } from "redux/actions/app";
import { doAuthNavigate } from "redux/actions/navigation";
import { doSetClientSetting } from "redux/actions/settings";
import { selectUserIsRewardApproved } from "redux/selectors/user";
import { selectBalance } from "redux/selectors/wallet";
import {
makeSelectHasClaimedReward,
makeSelectRewardByType,
selectUnclaimedRewardValue,
} from "selectors/rewards";
} from "redux/selectors/rewards";
import * as settings from "constants/settings";
import ModalCreditIntro from "./view";

View file

@ -4,7 +4,7 @@ import { CreditAmount, CurrencySymbol } from "component/common";
import Link from "component/link/index";
const ModalCreditIntro = props => {
const { closeModal, totalRewardValue, verifyAccount } = props;
const { closeModal, totalRewardValue, currentBalance, verifyAccount } = props;
const totalRewardRounded = Math.round(totalRewardValue / 10) * 10;
return (
@ -12,37 +12,41 @@ const ModalCreditIntro = props => {
<section>
<h3 className="modal__header">{__("Blockchain 101")}</h3>
<p>
LBRY is controlled and powered by a blockchain asset called {" "}
<em><CurrencySymbol /></em>.{" "}
<CurrencySymbol />{" "}
LBRY is controlled and powered by a blockchain asset called{" "}
<em>
<CurrencySymbol />
</em>. <CurrencySymbol />{" "}
{__(
"is used to publish content, to have a say in the network rules, and to access paid content."
)}
</p>
{currentBalance <= 0
? <div>
<p>
You currently have <CreditAmount amount={currentBalance} />, so
the actions you can take are limited.
</p>
<p>
However, there are a variety of ways to get credits, including
more than {" "}
{totalRewardValue
? <CreditAmount amount={totalRewardRounded} />
: <span className="credit-amount">{__("?? credits")}</span>}
{" "}{" "}
{__(
" in rewards available for being a proven human during the LBRY beta."
)}
</p>
</div>
: <div>
<p>
But you probably knew this, since you've already got{" "}
<CreditAmount amount={currentBalance} />.
</p>
</div>}
{currentBalance <= 0 ? (
<div>
<p>
You currently have <CreditAmount amount={currentBalance} />, so
the actions you can take are limited.
</p>
<p>
However, there are a variety of ways to get credits, including
more than{" "}
{totalRewardValue ? (
<CreditAmount amount={totalRewardRounded} />
) : (
<span className="credit-amount">{__("?? credits")}</span>
)}{" "}
{__(
" in rewards available for being a proven human during the LBRY beta."
)}
</p>
</div>
) : (
<div>
<p>
But you probably knew this, since you've already got{" "}
<CreditAmount amount={currentBalance} />.
</p>
</div>
)}
<div className="modal__buttons">
<Link

View file

@ -1,7 +1,10 @@
import React from "react";
import { connect } from "react-redux";
import { doStartUpgrade, doCancelUpgrade } from "actions/app";
import { selectDownloadProgress, selectDownloadComplete } from "selectors/app";
import { doStartUpgrade, doCancelUpgrade } from "redux/actions/app";
import {
selectDownloadProgress,
selectDownloadComplete,
} from "redux/selectors/app";
import ModalDownloading from "./view";
const select = state => ({

View file

@ -1,6 +1,6 @@
import React from "react";
import { connect } from "react-redux";
import { doCloseModal } from "actions/app";
import { doCloseModal } from "redux/actions/app";
import ModalError from "./view";
const perform = dispatch => ({

View file

@ -1,7 +1,7 @@
import React from "react";
import { connect } from "react-redux";
import { doCloseModal } from "actions/app";
import { makeSelectMetadataForUri } from "selectors/claims";
import { doCloseModal } from "redux/actions/app";
import { makeSelectMetadataForUri } from "redux/selectors/claims";
import ModalFileTimeout from "./view";
const select = state => ({

View file

@ -1,8 +1,8 @@
import React from "react";
import rewards from "rewards";
import { connect } from "react-redux";
import { doCloseModal } from "actions/app";
import { makeSelectRewardByType } from "selectors/rewards";
import { doCloseModal } from "redux/actions/app";
import { makeSelectRewardByType } from "redux/selectors/rewards";
import ModalFirstReward from "./view";
const select = (state, props) => {

View file

@ -1,6 +1,6 @@
import React from "react";
import { connect } from "react-redux";
import { doQuit, doSkipWrongDaemonNotice } from "actions/app";
import { doQuit, doSkipWrongDaemonNotice } from "redux/actions/app";
import ModalIncompatibleDaemon from "./view";
const select = state => ({});

View file

@ -1,7 +1,7 @@
import React from "react";
import { connect } from "react-redux";
import { doCloseModal } from "actions/app";
import { doNavigate } from "actions/navigation";
import { doCloseModal } from "redux/actions/app";
import { doNavigate } from "redux/actions/navigation";
import ModalInsufficientBalance from "./view";
const select = state => ({});

View file

@ -1,7 +1,7 @@
import React from "react";
import { connect } from "react-redux";
import { doCloseModal } from "actions/app";
import { doNavigate } from "actions/navigation";
import { doCloseModal } from "redux/actions/app";
import { doNavigate } from "redux/actions/navigation";
import ModalInsufficientCredits from "./view";
const select = state => ({});

View file

@ -1,9 +1,12 @@
import React from "react";
import { connect } from "react-redux";
import { doCloseModal } from "actions/app";
import { doDeleteFileAndGoBack } from "actions/file_info";
import { makeSelectTitleForUri, makeSelectClaimIsMine } from "selectors/claims";
import { makeSelectFileInfoForUri } from "selectors/file_info";
import { doCloseModal } from "redux/actions/app";
import { doDeleteFileAndGoBack } from "redux/actions/file_info";
import {
makeSelectTitleForUri,
makeSelectClaimIsMine,
} from "redux/selectors/claims";
import { makeSelectFileInfoForUri } from "redux/selectors/file_info";
import ModalRemoveFile from "./view";
const select = (state, props) => ({

View file

@ -1,8 +1,8 @@
import React from "react";
import { connect } from "react-redux";
import { doCloseModal } from "actions/app";
import { doAbandonClaim } from "actions/content";
import { selectTransactionItems } from "selectors/wallet";
import { doCloseModal } from "redux/actions/app";
import { doAbandonClaim } from "redux/actions/content";
import { selectTransactionItems } from "redux/selectors/wallet";
import ModalRevokeClaim from "./view";
const select = state => ({

View file

@ -1,7 +1,7 @@
import React from "react";
import { connect } from "react-redux";
import { doCloseModal } from "actions/app";
import { doAuthNavigate } from "actions/navigation";
import { doCloseModal } from "redux/actions/app";
import { doAuthNavigate } from "redux/actions/navigation";
import ModalRewardApprovalRequired from "./view";
const perform = dispatch => ({

View file

@ -1,13 +1,13 @@
import React from "react";
import { connect } from "react-redux";
import { doOpenModal } from "actions/app";
import { doOpenModal } from "redux/actions/app";
import * as settings from "constants/settings";
import { selectCurrentModal, selectModalProps } from "selectors/app";
import { selectCurrentPage } from "selectors/navigation";
import { selectCostForCurrentPageUri } from "selectors/cost_info";
import { makeSelectClientSetting } from "selectors/settings";
import { selectUser } from "selectors/user";
import { selectBalance } from "selectors/wallet";
import { selectCurrentModal, selectModalProps } from "redux/selectors/app";
import { selectCurrentPage } from "redux/selectors/navigation";
import { selectCostForCurrentPageUri } from "redux/selectors/cost_info";
import { makeSelectClientSetting } from "redux/selectors/settings";
import { selectUser } from "redux/selectors/user";
import { selectBalance } from "redux/selectors/wallet";
import ModalRouter from "./view";
const select = (state, props) => ({

View file

@ -1,6 +1,6 @@
import React from "react";
import { connect } from "react-redux";
import { doCloseModal } from "actions/app";
import { doCloseModal } from "redux/actions/app";
import ModalTransactionFailed from "./view";
const select = state => ({});

View file

@ -11,7 +11,7 @@ class ModalTransactionFailed extends React.PureComponent {
contentLabel={__("Transaction failed")}
onConfirmed={closeModal}
>
{__("Something went wrong")}:
{__("Transaction failed.")}:
</Modal>
);
}

View file

@ -1,6 +1,6 @@
import React from "react";
import { connect } from "react-redux";
import { doDownloadUpgrade, doSkipUpgrade } from "actions/app";
import { doDownloadUpgrade, doSkipUpgrade } from "redux/actions/app";
import ModalUpgrade from "./view";
const select = state => ({});

View file

@ -2,8 +2,8 @@ import React from "react";
import * as settings from "constants/settings";
import * as modals from "constants/modal_types";
import { connect } from "react-redux";
import { doCloseModal, doOpenModal } from "actions/app";
import { doSetClientSetting } from "actions/settings";
import { doCloseModal, doOpenModal } from "redux/actions/app";
import { doSetClientSetting } from "redux/actions/settings";
import ModalWelcome from "./view";
const perform = dispatch => () => ({

View file

@ -1,7 +1,7 @@
import React from "react";
import { doNavigate } from "actions/navigation";
import { doNavigate } from "redux/actions/navigation";
import { connect } from "react-redux";
import { selectPathAfterAuth } from "selectors/navigation";
import { selectPathAfterAuth } from "redux/selectors/navigation";
import {
selectAuthenticationIsPending,
selectEmailToVerify,
@ -9,14 +9,14 @@ import {
selectUser,
selectUserIsPending,
selectIdentityVerifyIsPending,
} from "selectors/user";
} from "redux/selectors/user";
import AuthPage from "./view";
const select = state => ({
isPending:
selectAuthenticationIsPending(state) ||
selectUserIsPending(state) ||
selectIdentityVerifyIsPending(state),
selectUserIsPending(state) ||
selectIdentityVerifyIsPending(state),
email: selectEmailToVerify(state),
pathAfterAuth: selectPathAfterAuth(state),
user: selectUser(state),

View file

@ -1,6 +1,6 @@
import React from "react";
import { connect } from "react-redux";
import { selectDaemonSettings } from "selectors/settings";
import { selectDaemonSettings } from "redux/selectors/settings";
import BackupPage from "./view";
const select = state => ({

View file

@ -3,18 +3,18 @@ import { connect } from "react-redux";
import {
doFetchClaimsByChannel,
doFetchClaimCountByChannel,
} from "actions/content";
} from "redux/actions/content";
import {
makeSelectClaimForUri,
makeSelectClaimsInChannelForCurrentPage,
makeSelectFetchingChannelClaims,
} from "selectors/claims";
} from "redux/selectors/claims";
import {
makeSelectCurrentParam,
selectCurrentParams,
} from "selectors/navigation";
import { doNavigate } from "actions/navigation";
import { makeSelectTotalPagesForChannel } from "selectors/content";
} from "redux/selectors/navigation";
import { doNavigate } from "redux/actions/navigation";
import { makeSelectTotalPagesForChannel } from "redux/selectors/content";
import ChannelPage from "./view";
const select = (state, props) => ({

View file

@ -1,10 +1,10 @@
import React from "react";
import { connect } from "react-redux";
import { doFetchFeaturedUris } from "actions/content";
import { doFetchFeaturedUris } from "redux/actions/content";
import {
selectFeaturedUris,
selectFetchingFeaturedUris,
} from "selectors/content";
} from "redux/selectors/content";
import DiscoverPage from "./view";
const select = state => ({

View file

@ -1,19 +1,19 @@
import React from "react";
import { connect } from "react-redux";
import { doNavigate } from "actions/navigation";
import { doFetchFileInfo } from "actions/file_info";
import { makeSelectFileInfoForUri } from "selectors/file_info";
import { selectRewardContentClaimIds } from "selectors/content";
import { doFetchCostInfoForUri } from "actions/cost_info";
import { doNavigate } from "redux/actions/navigation";
import { doFetchFileInfo } from "redux/actions/file_info";
import { makeSelectFileInfoForUri } from "redux/selectors/file_info";
import { selectRewardContentClaimIds } from "redux/selectors/content";
import { doFetchCostInfoForUri } from "redux/actions/cost_info";
import {
makeSelectClaimForUri,
makeSelectContentTypeForUri,
makeSelectMetadataForUri,
} from "selectors/claims";
import { makeSelectCostInfoForUri } from "selectors/cost_info";
import { selectShowNsfw } from "selectors/settings";
} from "redux/selectors/claims";
import { makeSelectCostInfoForUri } from "redux/selectors/cost_info";
import { selectShowNsfw } from "redux/selectors/settings";
import FilePage from "./view";
import { makeSelectCurrentParam } from "selectors/navigation";
import { makeSelectCurrentParam } from "redux/selectors/navigation";
const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),

View file

@ -1,16 +1,16 @@
import React from "react";
import { connect } from "react-redux";
import { doFetchFileInfosAndPublishedClaims } from "actions/file_info";
import { doFetchFileInfosAndPublishedClaims } from "redux/actions/file_info";
import {
selectFileInfosDownloaded,
selectIsFetchingFileListDownloadedOrPublished,
} from "selectors/file_info";
} from "redux/selectors/file_info";
import {
selectMyClaimsWithoutChannels,
selectIsFetchingClaimListMine,
} from "selectors/claims";
import { doFetchClaimListMine } from "actions/content";
import { doNavigate } from "actions/navigation";
} from "redux/selectors/claims";
import { doFetchClaimListMine } from "redux/actions/content";
import { doNavigate } from "redux/actions/navigation";
import FileListDownloaded from "./view";
const select = state => ({

View file

@ -1,13 +1,13 @@
import React from "react";
import rewards from "rewards";
import { connect } from "react-redux";
import { doFetchClaimListMine } from "actions/content";
import { doFetchClaimListMine } from "redux/actions/content";
import {
selectMyClaimsWithoutChannels,
selectIsFetchingClaimListMine,
} from "selectors/claims";
import { doClaimRewardType } from "actions/rewards";
import { doNavigate } from "actions/navigation";
} from "redux/selectors/claims";
import { doClaimRewardType } from "redux/actions/rewards";
import { doNavigate } from "redux/actions/navigation";
import FileListPublished from "./view";
const select = state => ({

View file

@ -1,8 +1,8 @@
import React from "react";
import { doAuthNavigate } from "actions/navigation";
import { doAuthNavigate } from "redux/actions/navigation";
import { connect } from "react-redux";
import { doFetchAccessToken } from "actions/user";
import { selectAccessToken, selectUser } from "selectors/user";
import { doFetchAccessToken } from "redux/actions/user";
import { selectAccessToken, selectUser } from "redux/selectors/user";
import HelpPage from "./view";
const select = state => ({

View file

@ -1,11 +1,11 @@
import React from "react";
import { connect } from "react-redux";
import InvitePage from "./view";
import { doFetchInviteStatus } from "actions/user";
import { doFetchInviteStatus } from "redux/actions/user";
import {
selectUserInviteStatusFailed,
selectUserInviteStatusIsPending,
} from "selectors/user";
} from "redux/selectors/user";
const select = state => ({
isFailed: selectUserInviteStatusFailed(state),

View file

@ -1,22 +1,22 @@
import React from "react";
import { connect } from "react-redux";
import { doNavigate, doHistoryBack } from "actions/navigation";
import { doClaimRewardType } from "actions/rewards";
import { doNavigate, doHistoryBack } from "redux/actions/navigation";
import { doClaimRewardType } from "redux/actions/rewards";
import {
selectMyClaims,
selectFetchingMyChannels,
selectMyChannelClaims,
selectClaimsByUri,
} from "selectors/claims";
import { selectResolvingUris } from "selectors/content";
} from "redux/selectors/claims";
import { selectResolvingUris } from "redux/selectors/content";
import {
doFetchClaimListMine,
doFetchChannelListMine,
doResolveUri,
doCreateChannel,
doPublish,
} from "actions/content";
import { selectBalance } from "selectors/wallet";
} from "redux/actions/content";
import { selectBalance } from "redux/selectors/wallet";
import rewards from "rewards";
import PublishPage from "./view";

View file

@ -1,7 +1,7 @@
import React from "react";
import Link from "component/link";
import { FormRow } from "component/form";
import { doShowSnackBar } from "actions/app";
import { doShowSnackBar } from "redux/actions/app";
import lbry from "../lbry.js";
class ReportPage extends React.Component {
@ -86,8 +86,7 @@ class ReportPage extends React.Component {
<section className="card">
<div className="card__content">
<h3>{__("Developer?")}</h3>
{__("You can also")}
{" "}
{__("You can also")}{" "}
<Link
href="https://github.com/lbryio/lbry/issues"
label={__("submit an issue on GitHub")}

View file

@ -3,10 +3,10 @@ import { connect } from "react-redux";
import {
selectFetchingRewards,
selectUnclaimedRewards,
} from "selectors/rewards";
import { selectUser } from "selectors/user";
import { doAuthNavigate, doNavigate } from "actions/navigation";
import { doRewardList } from "actions/rewards";
} from "redux/selectors/rewards";
import { selectUser } from "redux/selectors/user";
import { doAuthNavigate, doNavigate } from "redux/actions/navigation";
import { doRewardList } from "redux/actions/rewards";
import RewardsPage from "./view";
const select = (state, props) => {

View file

@ -1,7 +1,7 @@
import React from "react";
import { connect } from "react-redux";
import { selectIsSearching, selectSearchQuery } from "selectors/search";
import { doNavigate } from "actions/navigation";
import { selectIsSearching, selectSearchQuery } from "redux/selectors/search";
import { doNavigate } from "redux/actions/navigation";
import SearchPage from "./view";
const select = state => ({

View file

@ -1,20 +1,20 @@
import React from "react";
import { connect } from "react-redux";
import * as settings from "constants/settings";
import { doClearCache } from "actions/app";
import { doClearCache } from "redux/actions/app";
import {
doSetDaemonSetting,
doSetClientSetting,
doGetThemes,
doSetTheme,
doChangeLanguage,
} from "actions/settings";
} from "redux/actions/settings";
import {
makeSelectClientSetting,
selectDaemonSettings,
selectLanguages,
} from "selectors/settings";
import { selectCurrentLanguage } from "selectors/app";
} from "redux/selectors/settings";
import { selectCurrentLanguage } from "redux/selectors/app";
import SettingsPage from "./view";
const select = state => ({

View file

@ -1,8 +1,8 @@
import React from "react";
import { connect } from "react-redux";
import { doResolveUri } from "actions/content";
import { makeSelectClaimForUri } from "selectors/claims";
import { makeSelectIsUriResolving } from "selectors/content";
import { doResolveUri } from "redux/actions/content";
import { makeSelectClaimForUri } from "redux/selectors/claims";
import { makeSelectIsUriResolving } from "redux/selectors/content";
import ShowPage from "./view";
const select = (state, props) => ({

View file

@ -1,10 +1,10 @@
import React from "react";
import { connect } from "react-redux";
import { doFetchTransactions } from "actions/wallet";
import { doFetchTransactions } from "redux/actions/wallet";
import {
selectTransactionItems,
selectIsFetchingTransactions,
} from "selectors/wallet";
} from "redux/selectors/wallet";
import TransactionHistoryPage from "./view";
const select = state => ({

View file

@ -7,11 +7,11 @@ import {
selectUpgradeFilename,
selectIsUpgradeSkipped,
selectRemoteVersion,
} from "selectors/app";
import { doFetchDaemonSettings } from "actions/settings";
import { doBalanceSubscribe } from "actions/wallet";
import { doAuthenticate } from "actions/user";
import { doFetchFileInfosAndPublishedClaims } from "actions/file_info";
} from "redux/selectors/app";
import { doFetchDaemonSettings } from "redux/actions/settings";
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";
import { doFetchRewardedContent } from "actions/content";
import { selectCurrentModal } from "../selectors/app";
@ -20,7 +20,7 @@ const { remote, ipcRenderer, shell } = require("electron");
const path = require("path");
const { download } = remote.require("electron-dl");
const fs = remote.require("fs");
const { lbrySettings: config } = require("../../../app/package.json");
const { lbrySettings: config } = require("../../../../app/package.json");
const CHECK_UPGRADE_INTERVAL = 10 * 60 * 1000;
export function doOpenModal(modal, modalProps = {}) {

View file

@ -1,6 +1,6 @@
import * as types from "constants/action_types";
import lbry from "lbry";
import { selectFetchingAvailability } from "selectors/availability";
import { selectFetchingAvailability } from "redux/selectors/availability";
export function doFetchAvailability(uri) {
return function(dispatch, getState) {

View file

@ -3,18 +3,18 @@ import * as settings from "constants/settings";
import lbry from "lbry";
import lbryio from "lbryio";
import lbryuri from "lbryuri";
import { makeSelectClientSetting } from "selectors/settings";
import { selectBalance, selectTransactionItems } from "selectors/wallet";
import { makeSelectClientSetting } from "redux/selectors/settings";
import { selectBalance, selectTransactionItems } from "redux/selectors/wallet";
import {
makeSelectFileInfoForUri,
selectDownloadingByOutpoint,
} from "selectors/file_info";
import { selectResolvingUris } from "selectors/content";
import { makeSelectCostInfoForUri } from "selectors/cost_info";
import { doAlertError, doOpenModal } from "actions/app";
import { doClaimEligiblePurchaseRewards } from "actions/rewards";
import { selectBadgeNumber } from "selectors/app";
import { selectTotalDownloadProgress } from "selectors/file_info";
} from "redux/selectors/file_info";
import { selectResolvingUris } from "redux/selectors/content";
import { makeSelectCostInfoForUri } from "redux/selectors/cost_info";
import { doAlertError, doOpenModal } from "redux/actions/app";
import { doClaimEligiblePurchaseRewards } from "redux/actions/rewards";
import { selectBadgeNumber } from "redux/selectors/app";
import { selectTotalDownloadProgress } from "redux/selectors/file_info";
import setBadge from "util/setBadge";
import setProgressBar from "util/setProgressBar";
import batchActions from "util/batchActions";
@ -51,10 +51,10 @@ export function doResolveUris(uris) {
certificate: null,
};
const { claim, certificate, claims_in_channel } = uriResolveInfo &&
!uriResolveInfo.error
? uriResolveInfo
: fallbackResolveInfo;
const { claim, certificate, claims_in_channel } =
uriResolveInfo && !uriResolveInfo.error
? uriResolveInfo
: fallbackResolveInfo;
resolveInfo[uri] = { claim, certificate, claims_in_channel };
}

View file

@ -1,10 +1,10 @@
import * as types from "constants/action_types";
import lbry from "lbry";
import lbryio from "lbryio";
import { doResolveUri } from "actions/content";
import { selectResolvingUris } from "selectors/content";
import { selectClaimsByUri } from "selectors/claims";
import { selectSettingsIsGenerous } from "selectors/settings";
import { doResolveUri } from "redux/actions/content";
import { selectResolvingUris } from "redux/selectors/content";
import { selectClaimsByUri } from "redux/selectors/claims";
import { selectSettingsIsGenerous } from "redux/selectors/settings";
export function doFetchCostInfoForUri(uri) {
return function(dispatch, getState) {
@ -45,9 +45,10 @@ export function doFetchCostInfoForUri(uri) {
}, reject);
*/
const fee = claim.value && claim.value.stream && claim.value.stream.metadata
? claim.value.stream.metadata.fee
: undefined;
const fee =
claim.value && claim.value.stream && claim.value.stream.metadata
? claim.value.stream.metadata.fee
: undefined;
if (fee === undefined) {
resolve({ cost: 0, includesData: true });

View file

@ -1,19 +1,19 @@
import * as types from "constants/action_types";
import lbry from "lbry";
import { doFetchClaimListMine, doAbandonClaim } from "actions/content";
import { doFetchClaimListMine, doAbandonClaim } from "redux/actions/content";
import {
selectClaimsByUri,
selectIsFetchingClaimListMine,
selectMyClaimsOutpoints,
} from "selectors/claims";
} from "redux/selectors/claims";
import {
selectIsFetchingFileList,
selectFileInfosByOutpoint,
selectUrisLoading,
selectTotalDownloadProgress,
} from "selectors/file_info";
import { doCloseModal } from "actions/app";
import { doNavigate, doHistoryBack } from "actions/navigation";
} from "redux/selectors/file_info";
import { doCloseModal } from "redux/actions/app";
import { doNavigate, doHistoryBack } from "redux/actions/navigation";
import setProgressBar from "util/setProgressBar";
import batchActions from "util/batchActions";

View file

@ -6,8 +6,8 @@ import {
selectCurrentParams,
selectHistoryStack,
selectHistoryIndex,
} from "selectors/navigation";
import { doSearch } from "actions/search";
} from "redux/selectors/navigation";
import { doSearch } from "redux/actions/search";
import { toQueryString } from "util/query_params";
export function doNavigate(path, params = {}, options = {}) {
@ -21,21 +21,11 @@ export function doNavigate(path, params = {}, options = {}) {
url += "?" + toQueryString(params);
}
const state = getState(),
currentPage = selectCurrentPage(state),
nextPage = computePageFromPath(path),
scrollY = options.scrollY;
if (currentPage != nextPage) {
//I wasn't seeing it scroll to the proper position without this -- possibly because the page isn't fully rendered? Not sure - Jeremy
setTimeout(() => {
window.scrollTo(0, scrollY ? scrollY : 0);
}, 100);
}
const scrollY = options.scrollY;
dispatch({
type: types.HISTORY_NAVIGATE,
data: { url, index: options.index },
data: { url, index: options.index, scrollY },
});
};
}

View file

@ -2,8 +2,8 @@ import * as types from "constants/action_types";
import * as modals from "constants/modal_types";
import lbryio from "lbryio";
import rewards from "rewards";
import { selectUnclaimedRewardsByType } from "selectors/rewards";
import { selectUserIsRewardApproved } from "selectors/user";
import { selectUnclaimedRewardsByType } from "redux/selectors/rewards";
import { selectUserIsRewardApproved } from "redux/selectors/user";
export function doRewardList() {
return function(dispatch, getState) {
@ -93,12 +93,11 @@ export function doClaimEligiblePurchaseRewards() {
if (rewardsByType[rewards.TYPE_FIRST_STREAM]) {
dispatch(doClaimRewardType(rewards.TYPE_FIRST_STREAM));
} else {
[
rewards.TYPE_MANY_DOWNLOADS,
rewards.TYPE_FEATURED_DOWNLOAD,
].forEach(type => {
dispatch(doClaimRewardType(type));
});
[rewards.TYPE_MANY_DOWNLOADS, rewards.TYPE_FEATURED_DOWNLOAD].forEach(
type => {
dispatch(doClaimRewardType(type));
}
);
}
};
}

View file

@ -1,8 +1,8 @@
import * as types from "constants/action_types";
import lbryuri from "lbryuri";
import { doResolveUri } from "actions/content";
import { doNavigate } from "actions/navigation";
import { selectCurrentPage } from "selectors/navigation";
import { doResolveUri } from "redux/actions/content";
import { doNavigate } from "redux/actions/navigation";
import { selectCurrentPage } from "redux/selectors/navigation";
import batchActions from "util/batchActions";
export function doSearch(rawQuery) {

View file

@ -1,6 +1,6 @@
import * as types from "constants/action_types";
import * as settings from "constants/settings";
import { doAlertError } from "actions/app";
import { doAlertError } from "redux/actions/app";
import batchActions from "util/batchActions";
import lbry from "lbry";

View file

@ -1,9 +1,9 @@
import * as types from "constants/action_types";
import * as modals from "constants/modal_types";
import lbryio from "lbryio";
import { doOpenModal, doShowSnackBar } from "actions/app";
import { doRewardList, doClaimRewardType } from "actions/rewards";
import { selectEmailToVerify, selectUser } from "selectors/user";
import { doOpenModal, doShowSnackBar } from "redux/actions/app";
import { doRewardList, doClaimRewardType } from "redux/actions/rewards";
import { selectEmailToVerify, selectUser } from "redux/selectors/user";
import rewards from "rewards";
export function doAuthenticate() {
@ -69,7 +69,7 @@ export function doUserEmailNew(email) {
"post"
)
.catch(error => {
if (error.xhr && error.xhr.status == 409) {
if (error.response && error.response.status == 409) {
return lbryio.call(
"user_email",
"resend_token",

View file

@ -4,9 +4,9 @@ import {
selectDraftTransaction,
selectDraftTransactionAmount,
selectBalance,
} from "selectors/wallet";
import { doOpenModal, doShowSnackBar } from "actions/app";
import { doNavigate } from "actions/navigation";
} from "redux/selectors/wallet";
import { doOpenModal, doShowSnackBar } from "redux/actions/app";
import { doNavigate } from "redux/actions/navigation";
import * as modals from "constants/modal_types";
export function doUpdateBalance() {

Some files were not shown because too many files have changed in this diff Show more