From eb970c7873f5f03f45a6a5f296f2acc267337758 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Fri, 30 Nov 2018 00:49:02 -0500 Subject: [PATCH 1/5] wrap text properly in MD preview --- src/renderer/scss/component/_markdown-preview.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/renderer/scss/component/_markdown-preview.scss b/src/renderer/scss/component/_markdown-preview.scss index 62e5bb390..ad4d57d97 100644 --- a/src/renderer/scss/component/_markdown-preview.scss +++ b/src/renderer/scss/component/_markdown-preview.scss @@ -77,6 +77,10 @@ } // Code + pre { + white-space: normal; + } + code { margin: 16px 0; padding: 8px; From b773badef1356c53e018ac8658bf54d4a5d13428 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Fri, 30 Nov 2018 00:55:45 -0500 Subject: [PATCH 2/5] keep value of authToken --- src/renderer/index.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/renderer/index.js b/src/renderer/index.js index e88246e19..f3757339a 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -34,6 +34,7 @@ autoUpdater.logger = remote.require('electron-log'); // We need to override Lbryio for getting/setting the authToken // We interect with ipcRenderer to get the auth key from a users keyring +let authToken; Lbryio.setOverride('setAuthToken', status => { Lbryio.call( 'user', @@ -49,7 +50,9 @@ Lbryio.setOverride('setAuthToken', status => { throw new Error(__('auth_token is missing from response')); } - ipcRenderer.send('set-auth-token', response.auth_token); + const newAuthToken = response.auth_token; + authToken = newAuthToken; + ipcRenderer.send('set-auth-token', authToken); }); }); @@ -57,12 +60,16 @@ Lbryio.setOverride( 'getAuthToken', () => new Promise(resolve => { - ipcRenderer.once('auth-token-response', (event, token) => { - Lbryio.authToken = token; - resolve(token); - }); + if (authToken) { + resolve(authToken); + } else { + ipcRenderer.once('auth-token-response', (event, token) => { + Lbryio.authToken = token; + resolve(token); + }); - ipcRenderer.send('get-auth-token'); + ipcRenderer.send('get-auth-token'); + } }) ); From 46b47c3f8fc0c39097e27c1620bf207e9a7895ec Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Fri, 30 Nov 2018 12:57:12 -0500 Subject: [PATCH 3/5] use promise for setAuthToken so we only continue after the auth token has been set --- src/renderer/index.js | 45 +++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/src/renderer/index.js b/src/renderer/index.js index f3757339a..83b72db69 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -34,27 +34,34 @@ autoUpdater.logger = remote.require('electron-log'); // We need to override Lbryio for getting/setting the authToken // We interect with ipcRenderer to get the auth key from a users keyring +// We keep a local variable for authToken beacuse `ipcRenderer.send` does not +// contain a response, so there is no way to know when it's been set let authToken; -Lbryio.setOverride('setAuthToken', status => { - Lbryio.call( - 'user', - 'new', - { - auth_token: '', - language: 'en', - app_id: status.installation_id, - }, - 'post' - ).then(response => { - if (!response.auth_token) { - throw new Error(__('auth_token is missing from response')); - } +Lbryio.setOverride( + 'setAuthToken', + status => + new Promise(resolve => { + Lbryio.call( + 'user', + 'new', + { + auth_token: '', + language: 'en', + app_id: status.installation_id, + }, + 'post' + ).then(response => { + if (!response.auth_token) { + throw new Error(__('auth_token is missing from response')); + } - const newAuthToken = response.auth_token; - authToken = newAuthToken; - ipcRenderer.send('set-auth-token', authToken); - }); -}); + const newAuthToken = response.auth_token; + authToken = newAuthToken; + ipcRenderer.send('set-auth-token', authToken); + resolve(); + }); + }) +); Lbryio.setOverride( 'getAuthToken', From 99315560496404422469bd33d13e7dc59b3271bf Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Fri, 30 Nov 2018 13:06:00 -0500 Subject: [PATCH 4/5] fix windows process name to correctly check if the daemon is already running --- src/main/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/index.js b/src/main/index.js index 0da679b09..016d7d9f6 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -64,7 +64,7 @@ if (isDev) { } app.on('ready', async () => { - const processListArgs = process.platform === 'win32' ? 'lbrynet' : 'lbrynet start'; + const processListArgs = process.platform === 'win32' ? 'lbrynet.exe' : 'lbrynet start'; const processList = await findProcess('name', processListArgs); const isDaemonRunning = processList.length > 0; From 1bb0973c261c5282dab1704aa27f638980c55a29 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Fri, 30 Nov 2018 16:47:04 -0500 Subject: [PATCH 5/5] fix: always show tx filter --- src/renderer/component/transactionList/view.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/component/transactionList/view.jsx b/src/renderer/component/transactionList/view.jsx index ab69264dc..0f3790b89 100644 --- a/src/renderer/component/transactionList/view.jsx +++ b/src/renderer/component/transactionList/view.jsx @@ -82,7 +82,7 @@ class TransactionList extends React.PureComponent {

{emptyMessage || __('No transactions to list.')}

)} {!slim && - !!transactionList.length && ( + !!transactions.length && (