Merge branch 'master' into i18n + Windows development batch files

This commit is contained in:
Mayesters 2017-05-26 17:21:52 +02:00
commit 636a302e70
16 changed files with 85 additions and 37 deletions

View file

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

View file

@ -27,6 +27,16 @@ Web UI version numbers should always match the corresponding version of LBRY App
*
*
## [0.11.3] - 2017-05-26
### Fixed
* Fixed always showing welcome message on run
* "Fixed" upgrade process
* Version info now shows properly on Help page
* Claim info is properly accessed on Publish page
## [0.11.0] - 2017-05-25
### Added

View file

@ -68,6 +68,7 @@ function checkForNewVersion(callback) {
'User-Agent': `LBRY/${localVersion}`,
}
};
const req = https.get(Object.assign(opts, url.parse(LATEST_RELEASE_API_URL)), (res) => {
res.on('data', (data) => {
result += data;
@ -76,7 +77,6 @@ function checkForNewVersion(callback) {
const tagName = JSON.parse(result).tag_name;
const [_, remoteVersion] = tagName.match(/^v([\d.]+(?:-?rc\d+)?)$/);
if (!remoteVersion) {
console.log('Malformed remote version string:', tagName);
if (win) {
win.webContents.send('version-info-received', null);
}

View file

@ -1,6 +1,6 @@
{
"name": "LBRY",
"version": "0.11.0",
"version": "0.11.3",
"main": "main.js",
"description": "LBRY is a fully decentralized, open-source protocol facilitating the discovery, access, and (sometimes) purchase of data.",
"author": {

5
electron.bat Normal file
View file

@ -0,0 +1,5 @@
start /min %~dp0node_modules\.bin\electron app
pause

View file

@ -186,7 +186,7 @@ export function doCheckUpgradeAvailable() {
return function(dispatch, getState) {
const state = getState()
lbry.getVersionInfo().then(({remoteVersion, upgradeAvailable}) => {
lbry.getAppVersionInfo().then(({remoteVersion, upgradeAvailable}) => {
if (upgradeAvailable) {
dispatch({
type: types.UPDATE_VERSION,

View file

@ -8,7 +8,7 @@ import {RewardLink} from 'component/reward-link';
import {FormRow} from "../component/form.js";
import {CreditAmount, Address} from "../component/common.js";
import {getLocal, setLocal} from '../utils.js';
import {TYPE_NEW_USER} from '../rewards'
import rewards from '../rewards'
class SubmitEmailStage extends React.Component {
@ -288,7 +288,7 @@ export class AuthOverlay extends React.Component {
} else {
lbryio.call('reward', 'list', {}).then((userRewards) => {
userRewards.filter(function(reward) {
return reward.reward_type == TYPE_NEW_USER && reward.transaction_id;
return reward.reward_type == rewards.TYPE_NEW_USER && reward.transaction_id;
}).length ?
this.setStage(null) :
this.setStage("welcome")

View file

@ -17,7 +17,7 @@ class DownloadingModal extends React.Component {
return (
<Modal isOpen={true} contentLabel={__("Downloading Update")} type="custom">
{__("Downloading Update")}{downloadProgress ? `: ${downloadProgress}%` : null}
<Line percent={downloadProgress} strokeWidth="4"/>
<Line percent={downloadProgress ? downloadProgress : 0} strokeWidth="4"/>
{downloadComplete ? (
<div>
<br />

View file

@ -360,7 +360,7 @@ lbry.showMenuIfNeeded = function() {
sessionStorage.setItem('menuShown', chosenMenu);
};
lbry.getVersionInfo = function() {
lbry.getAppVersionInfo = function() {
return new Promise((resolve, reject) => {
ipcRenderer.once('version-info-received', (event, versionInfo) => { resolve(versionInfo) });
ipcRenderer.send('version-info-requested');

View file

@ -18,8 +18,7 @@ import {AuthOverlay} from 'component/auth.js';
import {
doChangePath,
doNavigate,
doDaemonReady,
doHistoryPush
doDaemonReady
} from 'actions/app'
import {
doFetchDaemonSettings

View file

@ -3,6 +3,7 @@ import React from 'react';
import lbry from 'lbry.js';
import Link from 'component/link';
import SubHeader from 'component/subHeader'
import {BusyMessage} from 'component/common'
import {version as uiVersion} from 'json!../../../package.json';
class HelpPage extends React.Component {
@ -16,11 +17,16 @@ class HelpPage extends React.Component {
}
componentWillMount() {
lbry.getVersionInfo((info) => {
lbry.getAppVersionInfo().then((info) => {
this.setState({
versionInfo: info,
appVersionInfo: info,
});
});
lbry.call('version', {}, (info) => {
this.setState({
versionInfo: info
})
})
lbry.getSessionInfo((info) => {
this.setState({
lbryId: info.lbry_id,
@ -37,7 +43,7 @@ class HelpPage extends React.Component {
if (this.state.versionInfo) {
ver = this.state.versionInfo;
console.log(ver)
if (ver.os_system == 'Darwin') {
osName = (parseInt(ver.os_release.match(/^\d+/)) < 16 ? 'Mac OS X' : 'Mac OS');
@ -87,14 +93,14 @@ class HelpPage extends React.Component {
<div className="meta">{__("Thanks! LBRY is made by its users.")}</div>
</div>
</section>
{!ver ? null :
<section className="card">
<section className="card">
<div className="card__title-primary"><h3>{__("About")}</h3></div>
<div className="card__content">
{ver.lbrynet_update_available || ver.lbryum_update_available ?
<div className="card__content">
{this.state.appVersionInfo ?
(ver.lbrynet_update_available || ver.lbryum_update_available ?
<p>{__("A newer version of LBRY is available.")} <Link href={newVerLink} label={__("Download LBRY %s now!"), ver.remote_lbrynet} /></p>
: <p>{__("Your copy of LBRY is up to date.")}</p>
}
{ ver ?
<table className="table-standard">
<tbody>
<tr>
@ -118,10 +124,11 @@ class HelpPage extends React.Component {
<td>{this.state.lbryId}</td>
</tr>
</tbody>
</table>
</div>
</section>
}
</table> :
<BusyMessage message="Looking up version info" />
}
</div>
</section>
</main>
);
}

View file

@ -206,18 +206,18 @@ class PublishPage extends React.Component {
nameResolved: false,
});
} else {
const topClaimIsMine = (myClaimInfo && myClaimInfo.claim.amount >= claimInfo.claim.amount);
const topClaimIsMine = myClaimInfo && myClaimInfo.amount >= claimInfo.amount;
const newState = {
nameResolved: true,
topClaimValue: parseFloat(claimInfo.claim.amount),
topClaimValue: parseFloat(claimInfo.amount),
myClaimExists: !!myClaimInfo,
myClaimValue: myClaimInfo ? parseFloat(myClaimInfo.claim.amount) : null,
myClaimValue: myClaimInfo ? parseFloat(myClaimInfo.amount) : null,
myClaimMetadata: myClaimInfo ? myClaimInfo.value : null,
topClaimIsMine: topClaimIsMine,
};
if (topClaimIsMine) {
newState.bid = myClaimInfo.claim.amount;
newState.bid = myClaimInfo.amount;
} else if (this.state.myClaimMetadata) {
// Just changed away from a name we have a claim on, so clear pre-fill
newState.bid = '';

View file

@ -27,7 +27,7 @@ reducers[types.CHANGE_PATH] = function(state, action) {
reducers[types.UPGRADE_CANCELLED] = function(state, action) {
return Object.assign({}, state, {
downloadProgress: null,
downloadComplete: false,
upgradeDownloadComplete: false,
modal: null,
})
}
@ -35,7 +35,8 @@ reducers[types.UPGRADE_CANCELLED] = function(state, action) {
reducers[types.UPGRADE_DOWNLOAD_COMPLETED] = function(state, action) {
return Object.assign({}, state, {
downloadDir: action.data.dir,
downloadComplete: true,
upgradeDownloading: false,
upgradeDownloadCompleted: true
})
}
@ -45,13 +46,6 @@ reducers[types.UPGRADE_DOWNLOAD_STARTED] = function(state, action) {
})
}
reducers[types.UPGRADE_DOWNLOAD_COMPLETED] = function(state, action) {
return Object.assign({}, state, {
upgradeDownloading: false,
upgradeDownloadCompleted: true
})
}
reducers[types.SKIP_UPGRADE] = function(state, action) {
sessionStorage.setItem('upgradeSkipped', true);

View file

@ -1,6 +1,6 @@
{
"name": "lbry-web-ui",
"version": "0.11.0",
"version": "0.11.3",
"description": "LBRY UI",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",

33
ui/watch.bat Normal file
View file

@ -0,0 +1,33 @@
rmdir %~dp0node_modules /s /q
rmdir %~dp0..\node_modules /s /q
rmdir %~dp0..\app\node_modules /s /q
call yarn install
echo f | xcopy /s /y %~dp0dist %~dp0..\app\dist
call %~dp0node_modules\.bin\node-sass --output %~dp0..\app\dist\css --sourcemap=none %~dp0scss\
start /min %~dp0node_modules\.bin\node-sass --output %~dp0..\app\dist\css --sourcemap=none --watch %~dp0scss\ &
call %~dp0node_modules\.bin\webpack --config webpack.dev.config.js --progress --colors
start /min %~dp0node_modules\.bin\webpack --config webpack.dev.config.js --progress --colors --watch
call yarn build:langs
cp %~dp0build\lang\en.json %~dp0..\app\dist\lang\en.json
cd %~dp0..\app
call yarn install
cd ..\
call yarn install
start /min %~dp0..\node_modules\.bin\electron app
exit 0

View file

@ -21,7 +21,7 @@ module.exports = {
},
plugins: [
new webpack.DefinePlugin({
ENV: JSON.stringify("development"),
ENV: JSON.stringify("production"),
}),
],
module: {