Merge pull request #865 from lbryio/issue/839

Fix error on settings page on development
This commit is contained in:
Liam Cardenas 2017-12-12 14:41:00 -08:00 committed by GitHub
commit 839835e89f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 31 additions and 35 deletions

View file

@ -84,7 +84,7 @@ fi
if ! cmd_exists node; then if ! cmd_exists node; then
if $LINUX; then if $LINUX; then
curl -sL https://deb.nodesource.com/setup_7.x | $SUDO -E bash - curl -sL https://deb.nodesource.com/setup_8.x | $SUDO -E bash -
$INSTALL nodejs $INSTALL nodejs
elif $OSX; then elif $OSX; then
brew install node brew install node

View file

@ -2,12 +2,18 @@
"name": "LBRY", "name": "LBRY",
"version": "0.19.1rc1", "version": "0.19.1rc1",
"description": "A browser for the LBRY network, a digital marketplace controlled by its users.", "description": "A browser for the LBRY network, a digital marketplace controlled by its users.",
"homepage": "https://lbry.io/",
"bugs": {
"url": "https://github.com/lbryio/lbry-app/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/lbryio/lbry-app"
},
"author": { "author": {
"name": "LBRY Inc.", "name": "LBRY Inc.",
"email": "hello@lbry.io" "email": "hello@lbry.io"
}, },
"homepage": "https://lbry.io/",
"license": "MIT",
"scripts": { "scripts": {
"extract-langs": "node src/renderer/extractLocals.js", "extract-langs": "node src/renderer/extractLocals.js",
"dev": "electron-webpack dev", "dev": "electron-webpack dev",
@ -17,14 +23,7 @@
"postinstall": "electron-builder install-app-deps", "postinstall": "electron-builder install-app-deps",
"precommit": "lint-staged" "precommit": "lint-staged"
}, },
"main": "src/main/main.js", "main": "src/main/index.js",
"repository": {
"type": "git",
"url": "https://github.com/lbryio/lbry-app"
},
"bugs": {
"url": "https://github.com/lbryio/lbry-app/issues"
},
"keywords": [ "keywords": [
"lbry" "lbry"
], ],
@ -94,6 +93,11 @@
"resolutions": { "resolutions": {
"webpack/webpack-sources": "1.0.1" "webpack/webpack-sources": "1.0.1"
}, },
"engines": {
"node": ">=6",
"yarn": "^1.3"
},
"license": "MIT",
"lint-staged": { "lint-staged": {
"src/**/*.{js,jsx}": [ "src/**/*.{js,jsx}": [
"prettier --trailing-comma es5 --write", "prettier --trailing-comma es5 --write",

View file

@ -1,5 +1,5 @@
const { app, shell, Menu } = require('electron'); const { app, shell, Menu } = require('electron');
const { safeQuit } = require('../main.js'); const { safeQuit } = require('../index.js');
const baseTemplate = [ const baseTemplate = [
{ {

View file

@ -5,7 +5,7 @@ import { CreditAmount } from "component/common";
type Props = { type Props = {
unclaimedRewardAmount: number, unclaimedRewardAmount: number,
} };
const RewardSummary = (props: Props) => { const RewardSummary = (props: Props) => {
const { unclaimedRewardAmount } = props; const { unclaimedRewardAmount } = props;
@ -19,11 +19,15 @@ const RewardSummary = (props: Props) => {
{unclaimedRewardAmount > 0 ? ( {unclaimedRewardAmount > 0 ? (
<p> <p>
{__("You have")}{" "} {__("You have")}{" "}
<CreditAmount amount={unclaimedRewardAmount} precision={8} /> <CreditAmount amount={unclaimedRewardAmount} precision={8} />{" "}
{" "}{__("in unclaimed rewards")}. {__("in unclaimed rewards")}.
</p> </p>
) : ( ) : (
<p>{__("There are no rewards available at this time, please check back later")}.</p> <p>
{__(
"There are no rewards available at this time, please check back later"
)}.
</p>
)} )}
</div> </div>
<div className="card__actions"> <div className="card__actions">

View file

@ -7,10 +7,6 @@ import lbry from "lbry";
import fs from "fs"; import fs from "fs";
import http from "http"; import http from "http";
const { remote } = require("electron");
const { extname } = require("path");
const { readdir } = remote.require("fs");
export function doFetchDaemonSettings() { export function doFetchDaemonSettings() {
return function(dispatch, getState) { return function(dispatch, getState) {
lbry.settings_get().then(settings => { lbry.settings_get().then(settings => {
@ -52,22 +48,14 @@ export function doSetClientSetting(key, value) {
export function doGetThemes() { export function doGetThemes() {
return function(dispatch, getState) { return function(dispatch, getState) {
const dir = `${staticResourcesPath}/themes`; const themes = ["light", "dark"];
dispatch(
doSetClientSetting(
settings.THEMES,
themes
)
);
readdir(dir, (error, files) => {
if (!error) {
dispatch(
doSetClientSetting(
settings.THEMES,
files
.filter(file => extname(file) === ".css")
.map(file => file.replace(".css", ""))
)
);
} else {
dispatch(doAlertError(error));
}
});
}; };
} }