commit
820886202d
4 changed files with 42 additions and 24 deletions
|
@ -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;
|
||||||
|
|
|
@ -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}
|
||||||
|
|
|
@ -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');
|
||||||
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Code
|
// Code
|
||||||
|
pre {
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
|
||||||
code {
|
code {
|
||||||
margin: 16px 0;
|
margin: 16px 0;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
|
|
Loading…
Reference in a new issue