private async Task OnNext(WalletManagerViewModel walletManagerViewModel, ClosedWalletViewModel closedWalletViewModel, Wallet wallet) { string?compatibilityPasswordUsed = null; var isPasswordCorrect = await Task.Run(() => wallet.TryLogin(Password, out compatibilityPasswordUsed)); if (!isPasswordCorrect) { ErrorMessage = "The password is incorrect! Try Again."; return; } if (compatibilityPasswordUsed is { })
private async Task OnNextAsync(ClosedWalletViewModel closedWalletViewModel, Wallet wallet) { string?compatibilityPasswordUsed = null; var isPasswordCorrect = await Task.Run(() => wallet.TryLogin(Password, out compatibilityPasswordUsed)); if (!isPasswordCorrect) { IsForgotPasswordVisible = true; ErrorMessage = "The password is incorrect! Please try again."; return; } if (compatibilityPasswordUsed is { })
public LoginViewModel(ClosedWalletViewModel closedWalletViewModel) { var wallet = closedWalletViewModel.Wallet; IsPasswordNeeded = !wallet.KeyManager.IsWatchOnly; WalletName = wallet.WalletName; _password = ""; _errorMessage = ""; WalletType = WalletHelpers.GetType(closedWalletViewModel.Wallet.KeyManager); NextCommand = ReactiveCommand.CreateFromTask(async() => await OnNextAsync(closedWalletViewModel, wallet)); OkCommand = ReactiveCommand.Create(OnOk); ForgotPasswordCommand = ReactiveCommand.Create(() => OnForgotPassword(wallet)); EnableAutoBusyOn(NextCommand); }
public LoginViewModel(WalletManagerViewModel walletManagerViewModel, ClosedWalletViewModel closedWalletViewModel) { var wallet = closedWalletViewModel.Wallet; IsPasswordNeeded = !wallet.KeyManager.IsWatchOnly; WalletName = wallet.WalletName; _password = ""; _errorMessage = ""; WalletIcon = wallet.KeyManager.Icon; IsHardwareWallet = wallet.KeyManager.IsHardwareWallet; NextCommand = ReactiveCommand.CreateFromTask(async() => await OnNext(walletManagerViewModel, closedWalletViewModel, wallet)); OkCommand = ReactiveCommand.Create(OnOk); ForgotPasswordCommand = ReactiveCommand.Create(() => OnForgotPassword(wallet)); EnableAutoBusyOn(NextCommand); }
public LoginViewModel(WalletManagerViewModel walletManagerViewModel, ClosedWalletViewModel closedWalletViewModel) { var wallet = closedWalletViewModel.Wallet; IsPasswordNeeded = !wallet.KeyManager.IsWatchOnly; WalletName = wallet.WalletName; _password = ""; _errorMessage = ""; WalletIcon = wallet.KeyManager.Icon; IsHardwareWallet = wallet.KeyManager.IsHardwareWallet; NextCommand = ReactiveCommand.CreateFromTask(async() => { string?compatibilityPasswordUsed = null; var isPasswordCorrect = await Task.Run(() => wallet.TryLogin(Password, out compatibilityPasswordUsed)); if (!isPasswordCorrect) { ErrorMessage = "The password is incorrect! Try Again."; return; } if (compatibilityPasswordUsed is { }) { await ShowErrorAsync(Title, PasswordHelper.CompatibilityPasswordWarnMessage, "Compatibility password was used"); } var legalResult = await ShowLegalAsync(walletManagerViewModel.LegalChecker); if (legalResult) { await LoginWalletAsync(walletManagerViewModel, closedWalletViewModel); } else { wallet.Logout(); ErrorMessage = "You must accept the Terms and Conditions!"; } });