about summary refs log tree commit diff
path: root/BugMine.Web/Pages/Projects/Index.razor
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-04-25 06:31:52 +0200
committerRory& <root@rory.gay>2024-04-25 06:31:52 +0200
commit3054b456dcb54f069a5d8aaa615c1dfe060eef9b (patch)
treece89fbd1478206ac19fefa23035b68801bd25d4e /BugMine.Web/Pages/Projects/Index.razor
parentAdd basic project management (diff)
downloadBugMine-3054b456dcb54f069a5d8aaa615c1dfe060eef9b.tar.xz
Add projects logic, start of issues
Diffstat (limited to 'BugMine.Web/Pages/Projects/Index.razor')
-rw-r--r--BugMine.Web/Pages/Projects/Index.razor17
1 files changed, 14 insertions, 3 deletions
diff --git a/BugMine.Web/Pages/Projects/Index.razor b/BugMine.Web/Pages/Projects/Index.razor

index eaf8dc1..47c2f4a 100644 --- a/BugMine.Web/Pages/Projects/Index.razor +++ b/BugMine.Web/Pages/Projects/Index.razor
@@ -2,7 +2,13 @@ @using LibMatrix.Homeservers <h3>Projects</h3> -@if (Projects.Count == 0) { +@if (Client == null) { + <p>Authenticating... <SimpleSpinner/></p> +} +else if (Projects is null) { + <p>Loading projects... <SimpleSpinner/></p> +} +else if (Projects.Count == 0) { <p>There are no projects to display.</p> } else { @@ -28,7 +34,7 @@ else { @code { private BugMineClient? Client { get; set; } - private List<BugMineProject> Projects { get; set; } = []; + private List<BugMineProject>? Projects { get; set; } private CancellationTokenSource? _cts = new(); protected override async Task OnInitializedAsync() { @@ -36,12 +42,17 @@ else { if (Client == null) { return; } - + StateHasChanged(); + await foreach (var project in Client.GetProjects()) { + Projects ??= []; Projects.Add(project); StateHasChanged(); // await Task.Delay(100); } + + Projects ??= []; + StateHasChanged(); } private async Task Navigate(BugMineProject project) {