fix version check on help

This commit is contained in:
Jeremy Kauffman 2017-05-31 12:22:50 -04:00
parent aa425c5c69
commit 149d1ef61f
3 changed files with 12 additions and 13 deletions

View file

@ -16,7 +16,7 @@ Web UI version numbers should always match the corresponding version of LBRY App
* *
### Fixed ### Fixed
* * Version upgrade check on help page
* *
### Deprecated ### Deprecated

View file

@ -100,7 +100,6 @@ lbry.connect = function() {
let tryNum = 0 let tryNum = 0
function checkDaemonStartedFailed() { function checkDaemonStartedFailed() {
console.log('status error try num ' + tryNum)
if (tryNum <= 100) { // Move # of tries into constant or config option if (tryNum <= 100) { // Move # of tries into constant or config option
setTimeout(() => { setTimeout(() => {
tryNum++ tryNum++
@ -114,7 +113,6 @@ lbry.connect = function() {
// Check every half second to see if the daemon is accepting connections // Check every half second to see if the daemon is accepting connections
function checkDaemonStarted() { function checkDaemonStarted() {
console.log('check daemon started try ' + tryNum)
lbry.call('status', {}, resolve, checkDaemonStartedFailed, checkDaemonStartedFailed) lbry.call('status', {}, resolve, checkDaemonStartedFailed, checkDaemonStartedFailed)
} }

View file

@ -4,7 +4,6 @@ import lbry from 'lbry.js';
import Link from 'component/link'; import Link from 'component/link';
import SubHeader from 'component/subHeader' import SubHeader from 'component/subHeader'
import {BusyMessage} from 'component/common' import {BusyMessage} from 'component/common'
import {version as uiVersion} from 'json!../../../package.json';
class HelpPage extends React.Component { class HelpPage extends React.Component {
constructor(props) { constructor(props) {
@ -13,13 +12,16 @@ class HelpPage extends React.Component {
this.state = { this.state = {
versionInfo: null, versionInfo: null,
lbryId: null, lbryId: null,
uiVersion: null,
upgradeAvailable: null
}; };
} }
componentWillMount() { componentWillMount() {
lbry.getAppVersionInfo().then((info) => { lbry.getAppVersionInfo().then(({remoteVersion, upgradeAvailable}) => {
this.setState({ this.setState({
appVersionInfo: info, uiVersion: remoteVersion,
upgradeAvailable: upgradeAvailable
}); });
}); });
lbry.call('version', {}, (info) => { lbry.call('version', {}, (info) => {
@ -43,7 +45,6 @@ class HelpPage extends React.Component {
if (this.state.versionInfo) { if (this.state.versionInfo) {
ver = this.state.versionInfo; ver = this.state.versionInfo;
console.log(ver)
if (ver.os_system == 'Darwin') { if (ver.os_system == 'Darwin') {
osName = (parseInt(ver.os_release.match(/^\d+/)) < 16 ? 'Mac OS X' : 'Mac OS'); osName = (parseInt(ver.os_release.match(/^\d+/)) < 16 ? 'Mac OS X' : 'Mac OS');
@ -96,11 +97,11 @@ class HelpPage extends React.Component {
<section className="card"> <section className="card">
<div className="card__title-primary"><h3>About</h3></div> <div className="card__title-primary"><h3>About</h3></div>
<div className="card__content"> <div className="card__content">
{this.state.appVersionInfo ? { this.state.upgradeAvailable === null ? '' :
(ver.lbrynet_update_available || ver.lbryum_update_available ? ( this.state.upgradeAvailable ?
<p>A newer version of LBRY is available. <Link href={newVerLink} label={`Download LBRY ${ver.remote_lbrynet} now!`} /></p> <p>A newer version of LBRY is available. <Link href={newVerLink} label={`Download now!`} /></p>
: <p>Your copy of LBRY is up to date.</p>) : null} : <p>Your copy of LBRY is up to date.</p>)}
{ ver ? { this.state.uiVersion && ver ?
<table className="table-standard"> <table className="table-standard">
<tbody> <tbody>
<tr> <tr>
@ -113,7 +114,7 @@ class HelpPage extends React.Component {
</tr> </tr>
<tr> <tr>
<th>interface</th> <th>interface</th>
<td>{uiVersion}</td> <td>{this.state.uiVersion}</td>
</tr> </tr>
<tr> <tr>
<th>Platform</th> <th>Platform</th>