wizard: disable password strenght meter on mobiles

pull/2/head
Jaquee 7 years ago
parent bcb7bcffdb
commit 0e6028aacf

@ -83,6 +83,10 @@ ColumnLayout {
}
function switchPage(next) {
// Android focus workaround
releaseFocus();
// save settings for current page;
if (next && typeof pages[currentPage].onPageClosed !== 'undefined') {
if (pages[currentPage].onPageClosed(settings) !== true) {

@ -42,19 +42,22 @@ ColumnLayout {
wizard.nextButton.enabled = passwordItem.password === retypePasswordItem.password
// scorePassword returns value from 0 to... lots
var strength = walletManager.getPasswordStrength(passwordItem.password);
// consider anything below 10 bits as dire
strength -= 10
if (strength < 0)
strength = 0
// use a slight parabola to discourage short passwords
strength = strength ^ 1.2 / 3
// mapScope does not clamp
if (strength > 100)
strength = 100
// privacyLevel component uses 1..13 scale
privacyLevel.fillLevel = Utils.mapScope(1, 100, 1, 13, strength)
// TODO: password strength meter segfaults on Android.
if (!isMobile) {
// scorePassword returns value from 0 to... lots
var strength = walletManager.getPasswordStrength(passwordItem.password);
// consider anything below 10 bits as dire
strength -= 10
if (strength < 0)
strength = 0
// use a slight parabola to discourage short passwords
strength = strength ^ 1.2 / 3
// mapScope does not clamp
if (strength > 100)
strength = 100
// privacyLevel component uses 1..13 scale
privacyLevel.fillLevel = Utils.mapScope(1, 100, 1, 13, strength)
}
}
function resetFocus() {
@ -85,6 +88,7 @@ ColumnLayout {
}
PrivacyLevelSmall {
visible: !isMobile //TODO: strength meter doesnt work on Android
Layout.topMargin: isMobile ? 20 * scaleRatio : 40 * scaleRatio
Layout.fillWidth: true
id: privacyLevel