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 () {
-

{ translate('INDEX.UNSUPPORTED_BROWSER') }

+

+ { translate('INDEX.UNSUPPORTED_BROWSER') } +

{ translate('INDEX.IE_UNSUPPORTED') }
@@ -49,7 +53,9 @@ const LoginRender = function () {
-

{translate('INDEX.WELCOME_LOGIN')}

+

+ {translate('INDEX.WELCOME_LOGIN')} +

{ translate('INDEX.SIGN_IN') } + || !this.state.loginPassphrase.length }>{ translate('INDEX.SIGN_IN') }
-

{ translate('INDEX.WELCOME_PLEASE_ADD') }

+

+ { translate('INDEX.WELCOME_PLEASE_ADD') } +

@@ -114,7 +125,6 @@ const LoginRender = function () {

{ translate('INDEX.SELECT_SEED_TYPE') }:

-
@@ -178,7 +188,7 @@ const LoginRender = function () {
-
+
+ + Weak seed!

+ Your seed must contain:
+ - at least 1 upper case letter
+ - at least 1 digit
+ - at least 1 special character
+ - minimum 10 characters long +
@@ -199,8 +217,12 @@ const LoginRender = function () { value={ this.state.randomSeedConfirm } onChange={ this.updateInput } id="rwalletseed"> - { translate('LOGIN.MUST_ENTER_SEED') }. - { translate('LOGIN.ENTER_VALUE_AGAIN') }. + + { translate('LOGIN.MUST_ENTER_SEED') }. + + + { translate('LOGIN.ENTER_VALUE_AGAIN') }. + diff --git a/react/src/components/login/login.scss b/react/src/components/login/login.scss index 9acede3..c93839c 100644 --- a/react/src/components/login/login.scss +++ b/react/src/components/login/login.scss @@ -58,4 +58,30 @@ textarea { .placeholder-label { color: #808080; +} + +.seed-tooltip { + .tooltiptext { + width: 230px; + padding: 10px 20px; + background-color: black; + color: #fff; + text-align: left; + border-radius: 6px; + position: absolute; + z-index: 1; + top: -5px; + left: 105%; + + &::after { + content: ''; + position: absolute; + top: 50%; + right: 100%; + margin-top: -5px; + border-width: 5px; + border-style: solid; + border-color: transparent black transparent transparent; + } + } } \ No newline at end of file