Merge pull request #97 from lbryio/lbry-id-new-method

Update API method used to get LBRY ID
This commit is contained in:
alexliebowitz 2016-11-30 00:34:18 -05:00 committed by GitHub
commit d913e0be63
2 changed files with 11 additions and 4 deletions

View file

@ -310,6 +310,9 @@ lbry.setClientSetting = function(setting, value) {
return localStorage.setItem('setting_' + setting, JSON.stringify(value));
}
lbry.getSessionInfo = function(callback) {
lbry.call('get_lbry_session_info', {}, callback);
}
lbry.reportBug = function(message, callback) {
lbry.call('upload_log', {

View file

@ -4,6 +4,7 @@ var HelpPage = React.createClass({
getInitialState: function() {
return {
versionInfo: null,
lbryId: null,
};
},
componentWillMount: function() {
@ -12,17 +13,20 @@ var HelpPage = React.createClass({
versionInfo: info,
});
});
lbry.getSessionInfo((info) => {
this.setState({
lbryId: info.lbry_id,
});
});
},
componentDidMount: function() {
document.title = "Help";
},
render: function() {
let ver, osName, platform, newVerLink, lbryId;
let ver, osName, platform, newVerLink;
if (this.state.versionInfo) {
ver = this.state.versionInfo;
lbryId = ver.lbry_id;
if (ver.os_system == 'Darwin') {
osName = (parseInt(ver.os_release.match(/^\d+/)) < 16 ? 'Mac OS X' : 'Mac OS');
@ -84,7 +88,7 @@ var HelpPage = React.createClass({
</tr>
<tr>
<th>Installation ID</th>
<td>{lbryId}</td>
<td>{this.state.lbryId}</td>
</tr>
</tbody>
</table>