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,35 +34,49 @@ 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
Lbryio.call( // contain a response, so there is no way to know when it's been set
'user', let authToken;
'new', Lbryio.setOverride(
{ 'setAuthToken',
auth_token: '', status =>
language: 'en', new Promise(resolve => {
app_id: status.installation_id, Lbryio.call(
}, 'user',
'post' 'new',
).then(response => { {
if (!response.auth_token) { auth_token: '',
throw new Error(__('auth_token is missing from response')); language: 'en',
} app_id: status.installation_id,
},
'post'
).then(response => {
if (!response.auth_token) {
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 => {
ipcRenderer.once('auth-token-response', (event, token) => { if (authToken) {
Lbryio.authToken = token; resolve(authToken);
resolve(token); } else {
}); ipcRenderer.once('auth-token-response', (event, token) => {
Lbryio.authToken = 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;