diff --git a/react/src/components/dashboard/walletsNativeSyncProgress/walletsNativeSyncProgress.js b/react/src/components/dashboard/walletsNativeSyncProgress/walletsNativeSyncProgress.js index 3b1ad92..941e372 100644 --- a/react/src/components/dashboard/walletsNativeSyncProgress/walletsNativeSyncProgress.js +++ b/react/src/components/dashboard/walletsNativeSyncProgress/walletsNativeSyncProgress.js @@ -48,6 +48,7 @@ class WalletsNativeSyncProgress extends React.Component { renderActivatingBestChainProgress() { if (this.props.Settings && this.props.Settings.debugLog) { + console.log('debugLog'); if (this.props.Settings.debugLog.indexOf('UpdateTip') > -1 && !this.props.Dashboard.progress && !this.props.Dashboard.progress.blocks) { @@ -80,7 +81,7 @@ class WalletsNativeSyncProgress extends React.Component { } } else if ( this.props.Settings.debugLog.indexOf('Still rescanning') > -1 && - !this.props.Dashboard.progress && + !this.props.Dashboard.progress || !this.props.Dashboard.progress.blocks ) { const temp = this.props.Settings.debugLog.split(' '); diff --git a/react/src/components/login/login.js b/react/src/components/login/login.js index a385ab0..9371574 100644 --- a/react/src/components/login/login.js +++ b/react/src/components/login/login.js @@ -34,7 +34,8 @@ class Login extends React.Component { isSeedConfirmError: false, isSeedBlank: false, displaySeedBackupModal: false, - customWalletSeed: false + customWalletSeed: false, + isCustomSeedWeak: false, }; this.toggleActivateCoinForm = this.toggleActivateCoinForm.bind(this); this.updateInput = this.updateInput.bind(this); @@ -209,8 +210,9 @@ class Login extends React.Component { isSeedConfirmError: false, isSeedBlank: false, displaySeedBackupModal: false, - customWalletSeed: false - }); + customWalletSeed: false, + isCustomSeedWeak: false, + }); } execWalletCreate() { @@ -228,20 +230,29 @@ class Login extends React.Component { }); } + // TODO: + // 1) disable register btn if seed or seed conf is incorrect + // 2) display explicit custom seed validation message handleRegisterWallet() { const enteredSeedsMatch = this.state.randomSeed === this.state.randomSeedConfirm; const isSeedBlank = this.isBlank(this.state.randomSeed); + // if custom seed check for string strength + // at least 1 letter in upper case + // at least 1 digit + // at least one special char + // min length 10 chars + + const _customSeed = this.state.customWalletSeed ? this.state.randomSeed.match('^(?=.*[A-Z])(?=.*[^<>{}\"/|;:.,~!?@#$%^=&*\\]\\\\()\\[_+]*$)(?=.*[0-9])(?=.*[a-z]).{10,99}$') : false; + + this.setState({ + isCustomSeedWeak: _customSeed === null ? true : false, + isSeedConfirmError: !enteredSeedsMatch ? true : false, + isSeedBlank: isSeedBlank ? true : false, + }); + if (enteredSeedsMatch && !isSeedBlank) { this.toggleSeedBackupModal(); - } else if (!enteredSeedsMatch) { - this.setState({ - isSeedConfirmError: true, - }); - } else if (isSeedBlank) { - this.setState({ - isSeedBlank: true - }); } } diff --git a/react/src/components/login/login.render.js b/react/src/components/login/login.render.js index 46d79ff..1e90bd3 100644 --- a/react/src/components/login/login.render.js +++ b/react/src/components/login/login.render.js @@ -25,12 +25,16 @@ const LoginRender = function () {