2022-01-09 13:33:22 +00:00
|
|
|
@page "/gallery"
|
|
|
|
@layout Shared.MainLayout
|
|
|
|
@using Wabbajack.Networking.WabbajackClientApi;
|
|
|
|
@using Wabbajack.DTOs
|
|
|
|
|
|
|
|
@inject Client _client
|
|
|
|
|
|
|
|
<div id="content">
|
2022-01-11 15:05:48 +00:00
|
|
|
@foreach (ModlistMetadata item in _listItems)
|
2022-01-09 13:33:22 +00:00
|
|
|
{
|
2022-01-11 15:05:48 +00:00
|
|
|
<ModlistItem Metadata=@item></ModlistItem>
|
2022-01-09 13:33:22 +00:00
|
|
|
}
|
2022-01-11 16:26:47 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
@code {
|
|
|
|
|
|
|
|
List<ModlistMetadata> _listItems = new();
|
|
|
|
|
|
|
|
protected override async Task<Task> OnAfterRenderAsync(bool firstRender)
|
|
|
|
{
|
|
|
|
if (!firstRender) return base.OnAfterRenderAsync(firstRender);
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
ModlistMetadata[] modLists = await _client.LoadLists();
|
|
|
|
_listItems = modLists.ToList();
|
|
|
|
StateHasChanged();
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
Console.WriteLine(ex);
|
|
|
|
}
|
|
|
|
|
|
|
|
return base.OnAfterRenderAsync(firstRender);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|