From 0e6760ea731c9fb845a122658e6023957fd319d6 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Sun, 29 Mar 2026 08:39:13 +0100 Subject: [PATCH] Fix display of latest record when db is empty --- lib/music_library_web/live/stats_live/index.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/music_library_web/live/stats_live/index.ex b/lib/music_library_web/live/stats_live/index.ex index 0825fd0f..50273127 100644 --- a/lib/music_library_web/live/stats_live/index.ex +++ b/lib/music_library_web/live/stats_live/index.ex @@ -489,7 +489,7 @@ defmodule MusicLibraryWeb.StatsLive.Index do """ end - attr :latest_record, Records.Record, required: true + attr :latest_record, Records.Record, required: false attr :collection_count, :integer, required: true attr :wishlist_count, :integer, required: true attr :scrobble_count, :integer, required: true @@ -498,7 +498,7 @@ defmodule MusicLibraryWeb.StatsLive.Index do ~H""" <.section> <:title>{gettext("Records")} -
+
<.album_preview record={@latest_record} title={gettext("Latest purchase")}