add legal docs to the action center when its available.
MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/LegalDocumentsViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/LegalDocumentsViewModel.cs
@@ -3,12 +3,13 @@ using WalletWasabi.Fluent.ViewModels.Navigation;
namespace WalletWasabi.Fluent.ViewModels.AddWallet
{
[NavigationMetaData(
- Title = "Terms and Conditions",
+ Title = "Legal Document",
Caption = "Displays terms and conditions",
Order = 3,
Category = "General",
Keywords = new[] { "View", "Legal", "Docs", "Documentation", "Terms", "Conditions", "Help" },
IconName = "info_regular",
+ Searchable = true,
NavigationTarget = NavigationTarget.DialogScreen)]
public partial class LegalDocumentsViewModel : RoutableViewModel
{

MODIFY
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
@@ -15,12 +15,15 @@ using WalletWasabi.Fluent.ViewModels.Settings;
using WalletWasabi.Fluent.ViewModels.TransactionBroadcasting;
using WalletWasabi.Fluent.ViewModels.HelpAndSupport;
using WalletWasabi.Fluent.ViewModels.OpenDirectory;
+using WalletWasabi.Legal;
+using WalletWasabi.Services;
namespace WalletWasabi.Fluent.ViewModels
{
public partial class MainViewModel : ViewModelBase, IDialogHost
{
private readonly Global _global;
+ private readonly LegalChecker _legalChecker;
[AutoNotify] private bool _isMainContentEnabled;
[AutoNotify] private bool _isDialogScreenEnabled;
[AutoNotify] private bool _isFullScreenEnabled;
@@ -39,6 +42,7 @@ namespace WalletWasabi.Fluent.ViewModels
public MainViewModel(Global global)
{
_global = global;
+ _legalChecker = global.LegalChecker;
_dialogScreen = new DialogScreenViewModel(800, 700);
@@ -192,6 +196,18 @@ namespace WalletWasabi.Fluent.ViewModels
return null;
});
+ RxApp.MainThreadScheduler.Schedule(async () =>
+ {
+ while (_legalChecker.CurrentLegalDocument is null)
+ {
+ await Task.Delay(TimeSpan.FromSeconds(5));
+ }
+
+ LegalDocumentsViewModel.RegisterLazy(() => new LegalDocumentsViewModel(_legalChecker.CurrentLegalDocument.Content));
+
+ _searchPage.RegisterSearchEntry(LegalDocumentsViewModel.MetaData);
+ });
+
UserSupportViewModel.RegisterLazy(() => new UserSupportViewModel());
BugReportLinkViewModel.RegisterLazy(() => new BugReportLinkViewModel());
DocsLinkViewModel.RegisterLazy(() => new DocsLinkViewModel());

MODIFY
WalletWasabi.Fluent/ViewModels/Search/SearchPageViewModel.cs
WalletWasabi.Fluent/ViewModels/Search/SearchPageViewModel.cs
@@ -82,7 +82,7 @@ namespace WalletWasabi.Fluent.ViewModels.Search
throw new Exception("Category already exists.");
}
- private void RegisterSearchEntry(NavigationMetaData metaData)
+ public void RegisterSearchEntry(NavigationMetaData metaData)
{
if (_categories.TryGetValue(metaData.Category, out var searchCategory))
{

add legal docs to the action center when its available.