remove undo code.
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacyControlViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacyControlViewModel.cs
@@ -76,8 +76,6 @@ public partial class PrivacyControlViewModel : DialogViewModelBase<IEnumerable<S
private readonly TransactionInfo _transactionInfo;
private readonly bool _isSilent;
- private readonly Stack<Pocket[]> _removedPocketStack;
-
[AutoNotify] private Pocket[] _usedPockets = Array.Empty<Pocket>();
private bool _isUpdating;
@@ -87,7 +85,6 @@ public partial class PrivacyControlViewModel : DialogViewModelBase<IEnumerable<S
_wallet = wallet;
_transactionInfo = transactionInfo;
_isSilent = isSilent;
- _removedPocketStack = new Stack<Pocket[]>();
Labels = new ObservableCollection<string>();
MustHaveLabels = new ObservableCollection<string>();
@@ -95,9 +92,6 @@ public partial class PrivacyControlViewModel : DialogViewModelBase<IEnumerable<S
SetupCancel(enableCancel: false, enableCancelOnEscape: true, enableCancelOnPressed: false);
EnableBack = true;
- var undoCommandCanExecute = this.WhenAnyValue(x => x.Labels.Count).Select(_ => _removedPocketStack.Count > 0);
- UndoCommand = ReactiveCommand.Create(OnUndo, undoCommandCanExecute);
-
NextCommand = ReactiveCommand.Create(() => Complete(UsedPockets));
Observable
@@ -149,11 +143,9 @@ public partial class PrivacyControlViewModel : DialogViewModelBase<IEnumerable<S
}
}
- public ICommand UndoCommand { get; }
+ public ObservableCollection<LabelViewModel> LabelsWhiteList { get; } = new();
- public ObservableCollection<LabelViewModel> LabelsWhiteList { get; } = new ObservableCollection<LabelViewModel>();
-
- public ObservableCollection<LabelViewModel> LabelsBlackList { get; } = new ObservableCollection<LabelViewModel>();
+ public ObservableCollection<LabelViewModel> LabelsBlackList { get; } = new();
public ObservableCollection<string> Labels { get; set; }
@@ -164,14 +156,6 @@ public partial class PrivacyControlViewModel : DialogViewModelBase<IEnumerable<S
Close(DialogResultKind.Normal, pockets.SelectMany(x => x.Coins));
}
- private void OnUndo()
- {
- var pocketsToUndo = _removedPocketStack.Pop();
- var newPockets = UsedPockets.Union(pocketsToUndo);
-
- UpdateLabels(newPockets);
- }
-
private void OnLabelsChanged()
{
if (_isUpdating)
@@ -185,7 +169,6 @@ public partial class PrivacyControlViewModel : DialogViewModelBase<IEnumerable<S
Dispatcher.UIThread.Post(() =>
{
- _removedPocketStack.Push(pocketsToRemove);
var newPockets = UsedPockets.Except(pocketsToRemove);
UpdateLabels(newPockets);

MODIFY
WalletWasabi.Fluent/Views/Wallets/Send/PrivacyControlView.axaml
WalletWasabi.Fluent/Views/Wallets/Send/PrivacyControlView.axaml
xmlns:converters="clr-namespace:WalletWasabi.Fluent.Converters"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:DataType="vm:PrivacyControlViewModel"
+ x:CompileBindings="True"
xmlns:i="using:Avalonia.Xaml.Interactivity"
xmlns:behaviors="clr-namespace:WalletWasabi.Fluent.Behaviors"
x:Class="WalletWasabi.Fluent.Views.Wallets.Send.PrivacyControlView">
<c:InfoMessage DockPanel.Dock="Bottom" HorizontalAlignment="Center" Margin="0 20" Opacity="0.6"
Content="Even if you left someone there, not all of them will know about this transaction." />
- <Button Content="Undo" Command="{Binding UndoCommand}" DockPanel.Dock="Top" />
<TextBlock Text="Remove the entities you cannot tolerate leaking information about this transaction:" DockPanel.Dock="Top" />
<DockPanel>

remove undo code.