Ejemplo n.º 1
0
        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 { })
Ejemplo n.º 2
0
    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 { })
Ejemplo n.º 3
0
    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);
    }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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!";
                }
            });