Skip to content

Commit

Permalink
Merge branch 'backport' of https://github.com/zkSNACKs/WalletWasabi i…
Browse files Browse the repository at this point in the history
…nto backport
  • Loading branch information
molnard committed Apr 2, 2021
2 parents aea48ab + 0b6e68d commit b30623e
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ public RecoverWalletViewModel(WalletManagerViewModel owner) : base("Recover Wall

MnemonicWords = "";

var numberOfWords = MnemonicWords.Split(' ', StringSplitOptions.RemoveEmptyEntries).Length;

var canExecute = Observable
.Merge(Observable.FromEventPattern(this, nameof(ErrorsChanged)).Select(_ => Unit.Default))
.Merge(this.WhenAnyValue(x => x.MnemonicWords).Select(_ => Unit.Default))
.ObserveOn(RxApp.MainThreadScheduler)
.Select(_ => !Validations.AnyErrors && (numberOfWords == 12 || numberOfWords == 15 || numberOfWords == 18 || numberOfWords == 21 || numberOfWords == 24));
.Select(_ =>
{
var numberOfWords = MnemonicWords.Split(' ', StringSplitOptions.RemoveEmptyEntries).Length;
return !Validations.AnyErrors && (numberOfWords == 12 || numberOfWords == 15 || numberOfWords == 18 || numberOfWords == 21 || numberOfWords == 24);
});

RecoverCommand = ReactiveCommand.Create(() => RecoverWallet(owner), canExecute);

Expand Down

0 comments on commit b30623e

Please sign in to comment.