allow different daemon versions and don't shut down with DAEMON_DEVELOPMENT env variable

This commit is contained in:
Sean Yesmunt 2018-07-11 00:14:50 -04:00
parent e317f573bf
commit e0500eedd9
3 changed files with 20 additions and 16 deletions

View file

@ -59,16 +59,18 @@ app.on('ready', async () => {
if (!isDaemonRunning) { if (!isDaemonRunning) {
daemon = new Daemon(); daemon = new Daemon();
daemon.on('exit', () => { daemon.on('exit', () => {
daemon = null; if (process.env.DAEMON_DEVELOPMENT) {
if (!appState.isQuitting) { daemon = null;
dialog.showErrorBox( if (!appState.isQuitting) {
'Daemon has Exited', dialog.showErrorBox(
'The daemon may have encountered an unexpected error, or another daemon instance is already running. \n\n' + 'Daemon has Exited',
'For more information please visit: \n' + 'The daemon may have encountered an unexpected error, or another daemon instance is already running. \n\n' +
'https://lbry.io/faq/startup-troubleshooting' 'For more information please visit: \n' +
); 'https://lbry.io/faq/startup-troubleshooting'
);
}
app.quit();
} }
app.quit();
}); });
daemon.launch(); daemon.launch();
} }

View file

@ -253,17 +253,19 @@ export function doCheckUpgradeSubscribe() {
export function doCheckDaemonVersion() { export function doCheckDaemonVersion() {
return dispatch => { return dispatch => {
Lbry.version().then(({ lbrynet_version: lbrynetVersion }) => { Lbry.version().then(({ lbrynet_version: lbrynetVersion }) => {
if (config.lbrynetDaemonVersion === lbrynetVersion) { // Avoid the incompatible daemon modal if running in dev mode
dispatch({ // Lets you run a different daemone than the one specificed in package.json
if (isDev || config.lbrynetDaemonVersion === lbrynetVersion) {
return dispatch({
type: ACTIONS.DAEMON_VERSION_MATCH, type: ACTIONS.DAEMON_VERSION_MATCH,
}); });
return;
} }
dispatch({ dispatch({
type: ACTIONS.DAEMON_VERSION_MISMATCH, type: ACTIONS.DAEMON_VERSION_MISMATCH,
}); });
dispatch(
return dispatch(
doNotify({ doNotify({
id: MODALS.INCOMPATIBLE_DAEMON, id: MODALS.INCOMPATIBLE_DAEMON,
}) })

View file

@ -13,9 +13,9 @@ export const validateSendTx = (formValues: DraftTxValues) => {
// All we need to check is if the address is valid // All we need to check is if the address is valid
// If values are missing, users wont' be able to submit the form // If values are missing, users wont' be able to submit the form
if (address && !regexAddress.test(address)) { // if (address && !regexAddress.test(address)) {
errors.address = __('Not a valid LBRY address'); // errors.address = __('Not a valid LBRY address');
} // }
return errors; return errors;
}; };