Merge pull request #3564

dfe8146 SettingsInfo, WizardRestoreWallet1, WizardCreateDevice1: Correct restore height date when typed in wrong format (rating89us)
This commit is contained in:
luigi1111
2021-06-16 14:53:44 -05:00
4 changed files with 18 additions and 24 deletions

View File

@@ -183,15 +183,8 @@ Rectangle {
wizardController.walletOptionsDeviceName = wizardCreateDevice1.deviceName;
if(lookahead.text)
wizardController.walletOptionsSubaddressLookahead = lookahead.text;
var _restoreHeight = 0;
if(restoreHeight.text){
// Parse date string or restore height as integer
if(restoreHeight.text.indexOf('-') === 4 && restoreHeight.text.length === 10){
_restoreHeight = Wizard.getApproximateBlockchainHeight(restoreHeight.text, Utils.netTypeToString());
} else {
_restoreHeight = parseInt(restoreHeight.text)
}
wizardController.walletOptionsRestoreHeight = _restoreHeight;
wizardController.walletOptionsRestoreHeight = Utils.parseDateStringOrRestoreHeightAsInteger(restoreHeight.text);
}
wizardController.walletCreatedFromDevice.connect(onCreateWalletFromDeviceCompleted);

View File

@@ -314,16 +314,8 @@ Rectangle {
break;
}
var _restoreHeight = 0;
if(restoreHeight.text){
// Parse date string or restore height as integer
if(restoreHeight.text.indexOf('-') === 4 && restoreHeight.text.length === 10){
_restoreHeight = Wizard.getApproximateBlockchainHeight(restoreHeight.text, Utils.netTypeToString());
} else {
_restoreHeight = parseInt(restoreHeight.text)
}
wizardController.walletOptionsRestoreHeight = _restoreHeight;
wizardController.walletOptionsRestoreHeight = Utils.parseDateStringOrRestoreHeightAsInteger(restoreHeight.text);
}
wizardStateView.state = "wizardRestoreWallet2";