Merge pull request #2129 from lbryio/rc-fixes

Rc fixes
This commit is contained in:
Sean Yesmunt 2018-12-03 11:09:16 -05:00 committed by GitHub
commit 820886202d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 24 deletions

View file

@ -64,7 +64,7 @@ if (isDev) {
} }
app.on('ready', async () => { 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 processList = await findProcess('name', processListArgs);
const isDaemonRunning = processList.length > 0; const isDaemonRunning = processList.length > 0;

View file

@ -82,7 +82,7 @@ class TransactionList extends React.PureComponent<Props> {
<p className="card__content">{emptyMessage || __('No transactions to list.')}</p> <p className="card__content">{emptyMessage || __('No transactions to list.')}</p>
)} )}
{!slim && {!slim &&
!!transactionList.length && ( !!transactions.length && (
<div className="card__actions card__actions--between"> <div className="card__actions card__actions--between">
<FileExporter <FileExporter
data={transactionList} data={transactionList}

View file

@ -34,7 +34,13 @@ autoUpdater.logger = remote.require('electron-log');
// We need to override Lbryio for getting/setting the authToken // We need to override Lbryio for getting/setting the authToken
// We interect with ipcRenderer to get the auth key from a users keyring // We interect with ipcRenderer to get the auth key from a users keyring
Lbryio.setOverride('setAuthToken', status => { // 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 =>
new Promise(resolve => {
Lbryio.call( Lbryio.call(
'user', 'user',
'new', 'new',
@ -49,20 +55,28 @@ Lbryio.setOverride('setAuthToken', status => {
throw new Error(__('auth_token is missing from response')); 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);
resolve();
}); });
})
);
Lbryio.setOverride( Lbryio.setOverride(
'getAuthToken', 'getAuthToken',
() => () =>
new Promise(resolve => { new Promise(resolve => {
if (authToken) {
resolve(authToken);
} else {
ipcRenderer.once('auth-token-response', (event, token) => { ipcRenderer.once('auth-token-response', (event, token) => {
Lbryio.authToken = token; Lbryio.authToken = token;
resolve(token); resolve(token);
}); });
ipcRenderer.send('get-auth-token'); ipcRenderer.send('get-auth-token');
}
}) })
); );

View file

@ -77,6 +77,10 @@
} }
// Code // Code
pre {
white-space: normal;
}
code { code {
margin: 16px 0; margin: 16px 0;
padding: 8px; padding: 8px;