From e0500eedd9e4cedebfedc2dd5f660d03e266dcb6 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 11 Jul 2018 00:14:50 -0400 Subject: [PATCH 1/3] allow different daemon versions and don't shut down with DAEMON_DEVELOPMENT env variable --- src/main/index.js | 20 +++++++++++--------- src/renderer/redux/actions/app.js | 10 ++++++---- src/renderer/util/form-validation.js | 6 +++--- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index 9b7b22f77..fe484b5c2 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -59,16 +59,18 @@ app.on('ready', async () => { if (!isDaemonRunning) { daemon = new Daemon(); daemon.on('exit', () => { - daemon = null; - if (!appState.isQuitting) { - dialog.showErrorBox( - 'Daemon has Exited', - 'The daemon may have encountered an unexpected error, or another daemon instance is already running. \n\n' + - 'For more information please visit: \n' + - 'https://lbry.io/faq/startup-troubleshooting' - ); + if (process.env.DAEMON_DEVELOPMENT) { + daemon = null; + if (!appState.isQuitting) { + dialog.showErrorBox( + 'Daemon has Exited', + 'The daemon may have encountered an unexpected error, or another daemon instance is already running. \n\n' + + 'For more information please visit: \n' + + 'https://lbry.io/faq/startup-troubleshooting' + ); + } + app.quit(); } - app.quit(); }); daemon.launch(); } diff --git a/src/renderer/redux/actions/app.js b/src/renderer/redux/actions/app.js index e2e433b02..8ed62cd88 100644 --- a/src/renderer/redux/actions/app.js +++ b/src/renderer/redux/actions/app.js @@ -253,17 +253,19 @@ export function doCheckUpgradeSubscribe() { export function doCheckDaemonVersion() { return dispatch => { Lbry.version().then(({ lbrynet_version: lbrynetVersion }) => { - if (config.lbrynetDaemonVersion === lbrynetVersion) { - dispatch({ + // Avoid the incompatible daemon modal if running in dev mode + // 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, }); - return; } dispatch({ type: ACTIONS.DAEMON_VERSION_MISMATCH, }); - dispatch( + + return dispatch( doNotify({ id: MODALS.INCOMPATIBLE_DAEMON, }) diff --git a/src/renderer/util/form-validation.js b/src/renderer/util/form-validation.js index 167e6c0b2..9e994c784 100644 --- a/src/renderer/util/form-validation.js +++ b/src/renderer/util/form-validation.js @@ -13,9 +13,9 @@ export const validateSendTx = (formValues: DraftTxValues) => { // All we need to check is if the address is valid // If values are missing, users wont' be able to submit the form - if (address && !regexAddress.test(address)) { - errors.address = __('Not a valid LBRY address'); - } + // if (address && !regexAddress.test(address)) { + // errors.address = __('Not a valid LBRY address'); + // } return errors; }; -- 2.45.2 From ca390a125f43d8db9bcf1514a7ae256bb87bbdad Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 11 Jul 2018 00:49:36 -0400 Subject: [PATCH 2/3] don't validate address if NO_ADDRESS_VALIDATION is passed in --- package.json | 2 +- src/main/index.js | 2 +- src/renderer/util/form-validation.js | 6 +++--- yarn.lock | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index affa9cabd..8f736508a 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "formik": "^0.10.4", "hast-util-sanitize": "^1.1.2", "keytar": "^4.2.1", - "lbry-redux": "lbryio/lbry-redux#341db02c090e0121ff7f5d2e74fa35b06213d858", + "lbry-redux": "lbryio/lbry-redux#a0d2d1ac532ade639d39c92f79678ac26e904dfd", "localforage": "^1.7.1", "mime": "^2.3.1", "mixpanel-browser": "^2.17.1", diff --git a/src/main/index.js b/src/main/index.js index fe484b5c2..0d908dff2 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -59,7 +59,7 @@ app.on('ready', async () => { if (!isDaemonRunning) { daemon = new Daemon(); daemon.on('exit', () => { - if (process.env.DAEMON_DEVELOPMENT) { + if (isDev) { daemon = null; if (!appState.isQuitting) { dialog.showErrorBox( diff --git a/src/renderer/util/form-validation.js b/src/renderer/util/form-validation.js index 9e994c784..2057ef390 100644 --- a/src/renderer/util/form-validation.js +++ b/src/renderer/util/form-validation.js @@ -13,9 +13,9 @@ export const validateSendTx = (formValues: DraftTxValues) => { // All we need to check is if the address is valid // If values are missing, users wont' be able to submit the form - // if (address && !regexAddress.test(address)) { - // errors.address = __('Not a valid LBRY address'); - // } + if (!process.env.NO_ADDRESS_VALIDATION && !regexAddress.test(address)) { + errors.address = __('Not a valid LBRY address'); + } return errors; }; diff --git a/yarn.lock b/yarn.lock index e20ccde57..37618b5c3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5564,9 +5564,9 @@ lazy-val@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/lazy-val/-/lazy-val-1.0.3.tgz#bb97b200ef00801d94c317e29dc6ed39e31c5edc" -lbry-redux@lbryio/lbry-redux#341db02c090e0121ff7f5d2e74fa35b06213d858: +lbry-redux@lbryio/lbry-redux#a0d2d1ac532ade639d39c92f79678ac26e904dfd: version "0.0.1" - resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/341db02c090e0121ff7f5d2e74fa35b06213d858" + resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/a0d2d1ac532ade639d39c92f79678ac26e904dfd" dependencies: proxy-polyfill "0.1.6" reselect "^3.0.0" -- 2.45.2 From 44d98ac4227631a7614d1559b7872f5514823dc9 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 11 Jul 2018 01:01:54 -0400 Subject: [PATCH 3/3] fix typo --- src/main/index.js | 2 +- src/renderer/redux/actions/app.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index 0d908dff2..5bb58725b 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -59,7 +59,7 @@ app.on('ready', async () => { if (!isDaemonRunning) { daemon = new Daemon(); daemon.on('exit', () => { - if (isDev) { + if (!isDev) { daemon = null; if (!appState.isQuitting) { dialog.showErrorBox( diff --git a/src/renderer/redux/actions/app.js b/src/renderer/redux/actions/app.js index 8ed62cd88..96d215e23 100644 --- a/src/renderer/redux/actions/app.js +++ b/src/renderer/redux/actions/app.js @@ -254,7 +254,7 @@ export function doCheckDaemonVersion() { return dispatch => { Lbry.version().then(({ lbrynet_version: lbrynetVersion }) => { // Avoid the incompatible daemon modal if running in dev mode - // Lets you run a different daemone than the one specificed in package.json + // Lets you run a different daemon than the one specified in package.json if (isDev || config.lbrynetDaemonVersion === lbrynetVersion) { return dispatch({ type: ACTIONS.DAEMON_VERSION_MATCH, -- 2.45.2