Skip to content

Commit

Permalink
Update coinjoin settings
Browse files Browse the repository at this point in the history
  • Loading branch information
wieslawsoltes committed Mar 13, 2024
1 parent ed97729 commit 3347e20
Showing 1 changed file with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ private CoinJoinSettingsViewModel(IWalletModel walletModel)
_wallet.Settings.Save();
}
});

Update();
}

public ICommand SetAutoCoinJoin { get; }
Expand All @@ -90,23 +92,29 @@ private CoinJoinSettingsViewModel(IWalletModel walletModel)
protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
{
base.OnNavigatedTo(isInHistory, disposables);
Update();
}

private void Update()
{
PlebStopThreshold = _wallet.Settings.PlebStopThreshold.ToString();
AnonScoreTarget = _wallet.Settings.AnonScoreTarget;

IsCoinjoinProfileSelected = _wallet.Settings.IsCoinjoinProfileSelected;
SelectedCoinjoinProfileName =
(_wallet.Settings.IsCoinjoinProfileSelected,
CoinJoinProfilesViewModel.IdentifySelectedProfile(_wallet.Settings)) switch
{
(true, CoinJoinProfileViewModelBase x) => x.Title,
(false, _) => "None",
_ => "Unknown"
};
CoinJoinProfilesViewModel.IdentifySelectedProfile(_wallet.Settings)) switch
{
(true, CoinJoinProfileViewModelBase x) => x.Title,
(false, _) => "None",
_ => "Unknown"
};
}

private async Task SelectCoinjoinProfileAsync()
{
await Navigate().To().CoinJoinProfiles(_wallet.Settings).GetResultAsync();
AutoCoinJoin = _wallet.Settings.AutoCoinjoin;
Update();
}
}

0 comments on commit 3347e20

Please sign in to comment.