about summary refs log tree commit diff
path: root/ModerationClient/ViewModels/ClientViewModel.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-08-08 02:57:34 +0200
committerRory& <root@rory.gay>2024-08-08 03:02:10 +0200
commitdf5fe7c86e41235f99a9b0d69519a18581eddd5e (patch)
treed7ae3b2c9b98ffcf4fbe4613091dfc7db7e2c62b /ModerationClient/ViewModels/ClientViewModel.cs
parentList rooms (diff)
downloadModerationClient-df5fe7c86e41235f99a9b0d69519a18581eddd5e.tar.xz
Further work
Diffstat (limited to '')
-rw-r--r--ModerationClient/ViewModels/ClientViewModel.cs14
1 files changed, 13 insertions, 1 deletions
diff --git a/ModerationClient/ViewModels/ClientViewModel.cs b/ModerationClient/ViewModels/ClientViewModel.cs

index 1e287ec..312b46a 100644 --- a/ModerationClient/ViewModels/ClientViewModel.cs +++ b/ModerationClient/ViewModels/ClientViewModel.cs
@@ -30,6 +30,7 @@ public partial class ClientViewModel : ViewModelBase { private readonly CommandLineConfiguration _cfg; private SpaceNode? _currentSpace; private readonly SpaceNode _allRoomsNode; + private string _status = "Loading..."; public ObservableCollection<SpaceNode> DisplayedSpaces { get; } = []; public ObservableDictionary<string, RoomNode> AllRooms { get; } = new(); @@ -38,12 +39,22 @@ public partial class ClientViewModel : ViewModelBase { set => SetProperty(ref _currentSpace, value); } + public string Status { + get => _status + " " + DateTime.Now; + set => SetProperty(ref _status, value); + } + public async Task Run() { + Status = "Interrupted."; + return; + Status = "Doing initial sync..."; var sh = new SyncStateResolver(_authService.Homeserver, _logger, storageProvider: new FileStorageProvider(Path.Combine(_cfg.ProfileDirectory, "syncCache"))); // var res = await sh.SyncAsync(); //await sh.OptimiseStore(); while (true) { + // Status = "Syncing..."; var res = await sh.ContinueAsync(); + Status = $"Processing sync... {res.next.NextBatch}"; await ApplySpaceChanges(res.next); //OnPropertyChanged(nameof(CurrentSpace)); //OnPropertyChanged(nameof(CurrentSpace.ChildRooms)); @@ -52,6 +63,7 @@ public partial class ClientViewModel : ViewModelBase { // GC.Collect(i, GCCollectionMode.Forced, blocking: true); // GC.WaitForPendingFinalizers(); // } + Status = "Syncing..."; } } @@ -72,7 +84,7 @@ public partial class ClientViewModel : ViewModelBase { } } - // await Task.WhenAll(tasks); + await Task.WhenAll(tasks); return;