From 735444f022c776b65e340f2bbea6c137ff1a40a3 Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Wed, 30 Nov 2016 00:23:45 -0500 Subject: [PATCH 1/2] Add lbry.getSessionInfo() --- js/lbry.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/lbry.js b/js/lbry.js index 63937a922..84ae56174 100644 --- a/js/lbry.js +++ b/js/lbry.js @@ -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', { From 406c37f9ff2eb0f13a0d9324b47fc16005ae63d6 Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Wed, 30 Nov 2016 00:23:57 -0500 Subject: [PATCH 2/2] Help: change method used to get LBRY ID Now uses lbry.getSessionInfo() instead of lbry.getVersionInfo() --- js/page/help.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/js/page/help.js b/js/page/help.js index 60c70d2a6..c409758f5 100644 --- a/js/page/help.js +++ b/js/page/help.js @@ -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({ Installation ID - {lbryId} + {this.state.lbryId}