Gordon Pedersen
0c3836b0c8
I was overcomplicating everything trying to reduce the render lag. Just simplify it a bit. It works.
24 lines
700 B
Text
24 lines
700 B
Text
@inject IJSRuntime JS
|
|
@inject State State
|
|
|
|
@if(statuses != null) foreach(Status status in statuses) {
|
|
<StatusCard status="@status"></StatusCard>
|
|
}
|
|
|
|
<LoadingCard id="statusLoading" icon="fa-solid fa-message-smile"></LoadingCard>
|
|
|
|
@code {
|
|
[Parameter]
|
|
public Func<Task<List<Status>?>> StatusFunc { get; set; }
|
|
[Parameter]
|
|
public bool Editable { get; set; } = false;
|
|
|
|
private List<Status>? statuses;
|
|
|
|
protected override async Task OnInitializedAsync() {
|
|
await base.OnInitializedAsync();
|
|
if (statuses == null || statuses.Count == 0) statuses = await StatusFunc();
|
|
await InvokeAsync(StateHasChanged);
|
|
await JS.InvokeVoidAsync("removeElementById", "statusLoading");
|
|
}
|
|
}
|