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,6 +59,7 @@ app.on('ready', async () => {
if (!isDaemonRunning) { if (!isDaemonRunning) {
daemon = new Daemon(); daemon = new Daemon();
daemon.on('exit', () => { daemon.on('exit', () => {
if (process.env.DAEMON_DEVELOPMENT) {
daemon = null; daemon = null;
if (!appState.isQuitting) { if (!appState.isQuitting) {
dialog.showErrorBox( dialog.showErrorBox(
@ -69,6 +70,7 @@ app.on('ready', async () => {
); );
} }
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;
}; };