diff --git a/.eslintrc.json b/.eslintrc.json
index ca6035fa1..b6cda7522 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -19,7 +19,8 @@
"__": true,
"__n": true,
"app": true,
- "IS_WEB": true
+ "IS_WEB": true,
+ "WEBPACK_PORT": true
},
"rules": {
"comma-dangle": ["error", "always-multiline"],
diff --git a/flow-typed/publish.js b/flow-typed/publish.js
index 27f626c6d..0d1cc0acf 100644
--- a/flow-typed/publish.js
+++ b/flow-typed/publish.js
@@ -4,7 +4,7 @@ declare type UpdatePublishFormData = {
filePath?: string,
contentIsFree?: boolean,
fee?: {
- amount: number,
+ amount: string,
currency: string,
},
title?: string,
diff --git a/package.json b/package.json
index af107dd5b..051580488 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "LBRY",
- "version": "0.32.0-rc.1",
+ "version": "0.32.0-rc.6",
"description": "A browser for the LBRY network, a digital marketplace controlled by its users.",
"keywords": [
"lbry"
@@ -26,7 +26,7 @@
"dev": "yarn dev:electron",
"dev:electron": "cross-env NODE_ENV=development node ./src/platforms/electron/devServer.js",
"dev:web": "cross-env NODE_ENV=development webpack-dev-server --open --hot --progress --config webpack.web.config.js",
- "dev:internal-apis": "LBRY_API_URL='http://localhost:9090' yarn dev:electron",
+ "dev:internal-apis": "LBRY_API_URL='http://localhost:8080' yarn dev:electron",
"run:web": "cross-env NODE_ENV=production yarn compile:web && node ./dist/web/server.js",
"pack": "electron-builder --dir",
"dist": "electron-builder",
@@ -117,7 +117,7 @@
"jsmediatags": "^3.8.1",
"json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git",
- "lbry-redux": "lbryio/lbry-redux#c8126ab21792d7a85e1123a2363af285a0263654",
+ "lbry-redux": "lbryio/lbry-redux#02f6918238110726c0b3b4248c61a84ac0b969e3",
"lbryinc": "lbryio/lbryinc#43d382d9b74d396a581a74d87e4c53105e04f845",
"lint-staged": "^7.0.2",
"localforage": "^1.7.1",
@@ -151,7 +151,6 @@
"react-router-dom": "^5.0.0",
"react-simplemde-editor": "^4.0.0",
"react-toggle": "^4.0.2",
- "react-virtualized": "^9.21.0",
"redux": "^3.6.0",
"redux-persist": "^4.8.0",
"redux-persist-transform-compress": "^4.2.0",
@@ -188,7 +187,7 @@
"yarn": "^1.3"
},
"lbrySettings": {
- "lbrynetDaemonVersion": "0.37.0rc5",
+ "lbrynetDaemonVersion": "0.37.0",
"lbrynetDaemonUrlTemplate": "https://github.com/lbryio/lbry/releases/download/vDAEMONVER/lbrynet-OSNAME.zip",
"lbrynetDaemonDir": "static/daemon",
"lbrynetDaemonFileName": "lbrynet"
diff --git a/src/platforms/electron/createWindow.js b/src/platforms/electron/createWindow.js
index 79f7ed769..584e6d536 100644
--- a/src/platforms/electron/createWindow.js
+++ b/src/platforms/electron/createWindow.js
@@ -36,7 +36,7 @@ export default appState => {
};
const lbryProto = 'lbry://';
const lbryProtoQ = 'lbry://?';
- const rendererURL = isDev ? `http://localhost:8080` : `file://${__dirname}/index.html`;
+ const rendererURL = isDev ? `http://localhost:${WEBPACK_PORT}` : `file://${__dirname}/index.html`;
let window = new BrowserWindow(windowConfiguration);
diff --git a/src/platforms/electron/devServer.js b/src/platforms/electron/devServer.js
index a8c16a220..85ef85696 100644
--- a/src/platforms/electron/devServer.js
+++ b/src/platforms/electron/devServer.js
@@ -1,5 +1,3 @@
-const fs = require('fs');
-const path = require('path');
const chalk = require('chalk');
const webpack = require('webpack');
const merge = require('webpack-merge');
@@ -7,12 +5,9 @@ const middleware = require('webpack-dev-middleware');
const express = require('express');
const app = express();
-// TODO: Spawn separate threads so realtime status logging can be used
-// without overwriting information/execptions logged by the compilers
-const logRealtime = str => {
- let lineCount = (str.match(/\n/) || []).length + 1;
- console.log('\u001B[' + lineCount + 'F\u001B[G\u001B[2K' + str);
-};
+// Primary definition for this is in webpack.web.config.js
+// We can't access it here because webpack isn't running on this file
+const WEBPACK_PORT = 9090;
console.log(
chalk.magenta(`Compiling ${chalk.underline('main')} and ${chalk.underline('render')}, this will take a while.`)
@@ -46,8 +41,8 @@ app.use(require('webpack-hot-middleware')(renderCompiler));
app.use(renderInstance);
app.use(express.static('dist/electron/static'));
-app.listen(8080, () => {
- console.log(chalk.yellow.bold('Renderer listening on port 8080 (still compiling)'));
+app.listen(WEBPACK_PORT, () => {
+ console.log(chalk.yellow.bold(`Renderer listening on port ${WEBPACK_PORT} (still compiling)`));
});
mainInstance.waitUntilValid(() => console.log(chalk.green(`${chalk.underline('main')} compilation complete.`)));
diff --git a/src/ui/component/channelThumbnail/gerbil.png b/src/ui/component/channelThumbnail/gerbil.png
new file mode 100644
index 000000000..c19e658d2
Binary files /dev/null and b/src/ui/component/channelThumbnail/gerbil.png differ
diff --git a/src/ui/component/channelThumbnail/view.jsx b/src/ui/component/channelThumbnail/view.jsx
index 054f1021e..d52df8292 100644
--- a/src/ui/component/channelThumbnail/view.jsx
+++ b/src/ui/component/channelThumbnail/view.jsx
@@ -1,15 +1,30 @@
// @flow
import React from 'react';
+import { parseURI } from 'lbry-redux';
+import classnames from 'classnames';
+import Gerbil from './gerbil.png';
type Props = {
thumbnail: ?string,
+ uri: string,
};
function ChannelThumbnail(props: Props) {
- const { thumbnail } = props;
+ const { thumbnail, uri } = props;
+
+ // Generate a random color class based on the first letter of the channel name
+ const { channelName } = parseURI(uri);
+ const initializer = channelName.charCodeAt(0) - 65; // will be between 0 and 57
+ const className = `channel-thumbnail__default--${initializer % 4}`;
+
return (
-
- {thumbnail &&
}
+
+ {!thumbnail &&
}
+ {thumbnail &&
}
);
}
diff --git a/src/ui/component/common/icon.jsx b/src/ui/component/common/icon.jsx
index 79b2365ef..fc13a5851 100644
--- a/src/ui/component/common/icon.jsx
+++ b/src/ui/component/common/icon.jsx
@@ -25,7 +25,7 @@ class IconComponent extends React.PureComponent
{
switch (icon) {
case ICONS.FEATURED:
return __('Featured content. Earn rewards for watching.');
- case ICONS.LOCAL:
+ case ICONS.DOWNLOAD:
return __('This file is downloaded.');
default:
return null;
diff --git a/src/ui/component/common/paginate.jsx b/src/ui/component/common/paginate.jsx
index c30be815f..70c21f331 100644
--- a/src/ui/component/common/paginate.jsx
+++ b/src/ui/component/common/paginate.jsx
@@ -16,7 +16,7 @@ type Props = {
};
function Paginate(props: Props) {
- const { totalPages, loading, location, history, onPageChange } = props;
+ const { totalPages = 1, loading, location, history, onPageChange } = props;
const { search } = location;
const urlParams = new URLSearchParams(search);
const currentPage = Number(urlParams.get(PAGINATE_PARAM)) || 1;
diff --git a/src/ui/component/errorBoundary/view.jsx b/src/ui/component/errorBoundary/view.jsx
index 39751f9e0..632f0c2d2 100644
--- a/src/ui/component/errorBoundary/view.jsx
+++ b/src/ui/component/errorBoundary/view.jsx
@@ -3,19 +3,25 @@ import { Lbryio } from 'lbryinc';
import * as React from 'react';
import Yrbl from 'component/yrbl';
import Button from 'component/button';
+import { withRouter } from 'react-router';
type Props = {
children: React.Node,
+ history: {
+ replace: string => void,
+ },
};
type State = {
hasError: boolean,
};
-export default class ErrorBoundary extends React.Component {
+class ErrorBoundary extends React.Component {
constructor() {
super();
this.state = { hasError: false };
+
+ (this: any).refresh = this.refresh.bind(this);
}
static getDerivedStateFromError() {
@@ -35,6 +41,13 @@ export default class ErrorBoundary extends React.Component {
}
}
+ refresh() {
+ const { history } = this.props;
+ // use history.replace instead of history.push so the user can't click back to the errored page
+ history.replace('');
+ this.setState({ hasError: false });
+ }
+
render() {
if (this.state.hasError) {
return (
@@ -50,7 +63,7 @@ export default class ErrorBoundary extends React.Component {
button="link"
className="load-screen__button"
label={__('refreshing the app')}
- onClick={() => (window.location.href = '/')}
+ onClick={this.refresh}
/>{' '}
{__('to fix it')}.
@@ -64,3 +77,5 @@ export default class ErrorBoundary extends React.Component {
return this.props.children;
}
}
+
+export default withRouter(ErrorBoundary);
diff --git a/src/ui/component/fileCard/view.jsx b/src/ui/component/fileCard/view.jsx
index 351d5585e..a2d4e88d7 100644
--- a/src/ui/component/fileCard/view.jsx
+++ b/src/ui/component/fileCard/view.jsx
@@ -12,7 +12,6 @@ import { openCopyLinkMenu } from 'util/context-menu';
import DateTime from 'component/dateTime';
import { withRouter } from 'react-router-dom';
import { formatLbryUriForWeb } from 'util/uri';
-import get from 'lodash.get';
type Props = {
uri: string,
@@ -65,7 +64,6 @@ class FileCard extends React.PureComponent {
const {
claim,
fileInfo,
- metadata,
rewardedContentClaimIds,
obscureNsfw,
claimIsMine,
@@ -106,7 +104,6 @@ class FileCard extends React.PureComponent {
const uri = !pending ? normalizeURI(this.props.uri) : this.props.uri;
const isRewardContent = claim && rewardedContentClaimIds.includes(claim.claim_id);
- const height = claim && claim.height;
const handleContextMenu = event => {
event.preventDefault();
event.stopPropagation();
@@ -146,7 +143,7 @@ class FileCard extends React.PureComponent {
{isRewardContent && }
{isSubscribed && }
{claimIsMine && }
- {!claimIsMine && fileInfo && }
+ {!claimIsMine && fileInfo && }
{isNew && {__('NEW')}}
diff --git a/src/ui/component/fileDetails/view.jsx b/src/ui/component/fileDetails/view.jsx
index 2ee12f074..7645d1f9d 100644
--- a/src/ui/component/fileDetails/view.jsx
+++ b/src/ui/component/fileDetails/view.jsx
@@ -92,7 +92,6 @@ class FileDetails extends PureComponent {
{__('Downloaded to')}
{': '}