Skip to content

Commit b975e72

Browse files
committed
Add Albums to cached pages
1 parent 4a1e0a0 commit b975e72

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

BlazorDiffusion/Configure.Ui.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ public void Configure(IWebHostBuilder builder) => builder
4242
PrerenderDir = "/prerender",
4343
Renderer = c.Resolve<IComponentRenderer>(),
4444
Pages = {
45-
new(typeof(Pages.Index), "/index.html", new() { [nameof(Pages.Index.LazyLoad)] = "false" }),
46-
//new(typeof(Pages.Create), "/create.html"), // needs to be signed in
45+
new(typeof(Pages.Index), "/index.html", new() { [nameof(Pages.Index.LazyLoad)] = "false" }),
46+
new(typeof(Pages.Albums), "/albums.html", new() { [nameof(Pages.Index.LazyLoad)] = "false" }),
4747
}
4848
});
4949
});

BlazorDiffusion/Pages/Albums.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<NavLink href=@($"/?album={album.AlbumRef}&source={AppSource.Albums}")
2525
class=@ClassNames("overflow-hidden flex justify-center")>
2626
<div class="relative sm:p-2 flex flex-col cursor-pointer items-center w-32 h-32 sm:w-64 sm:h-64 xl:w-96 xl:h-96 2xl:w-[512px] 2xl:h-[512px]">
27-
<ArtifactImage Artifact="artifact" LazyLoad="true"
27+
<ArtifactImage Artifact="artifact" LazyLoad="LazyLoad ?? true"
2828
class=@ClassNames("flex rounded sm:rounded-xl w-full h-full") ImageClass="object-cover" />
2929

3030
<div class="absolute top-0 left-0 w-full h-full group select-none overflow-hidden sm:m-1 rounded sm:rounded-xl">

BlazorDiffusion/Pages/Albums.razor.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ namespace BlazorDiffusion.Pages;
88

99
public partial class Albums : AppAuthComponentBase
1010
{
11-
ApiResult<GetAlbumIdsResponse> api = new();
11+
[Parameter, SupplyParameterFromQuery] public bool? LazyLoad { get; set; }
12+
13+
[Inject] IIntersectionObserverService ObserverService { get; set; } = default!;
14+
[Inject] ILogger<Favorites> Log { get; set; } = default!;
1215

16+
ApiResult<GetAlbumIdsResponse> api = new();
1317
List<AlbumResult> results = new();
1418
public ElementReference BottomElement { get; set; }
1519
IntersectionObserver? bottomObserver;
16-
[Inject] IIntersectionObserverService ObserverService { get; set; } = default!;
17-
[Inject] ILogger<Favorites> Log { get; set; } = default!;
1820

1921
bool hasMore;
2022

0 commit comments

Comments
 (0)