From 80a32371e1dc2efd058b58ba78ab26af33576e67 Mon Sep 17 00:00:00 2001 From: Jonathan Jogenfors Date: Sat, 21 Mar 2026 00:05:55 +0100 Subject: [PATCH] fix Daniel's comments --- .../ServerStatisticsCard.svelte | 8 +-- .../ServerStatisticsPanel.svelte | 7 ++- .../library-management/(list)/+layout.svelte | 50 ++++--------------- .../library-management/(list)/+layout.ts | 3 +- .../library-management/[id]/+layout.svelte | 21 +++----- .../admin/library-management/[id]/+layout.ts | 3 +- 6 files changed, 28 insertions(+), 64 deletions(-) diff --git a/web/src/lib/components/server-statistics/ServerStatisticsCard.svelte b/web/src/lib/components/server-statistics/ServerStatisticsCard.svelte index 13daf14a3a..6e45669b40 100644 --- a/web/src/lib/components/server-statistics/ServerStatisticsCard.svelte +++ b/web/src/lib/components/server-statistics/ServerStatisticsCard.svelte @@ -2,10 +2,10 @@ import { ByteUnit } from '$lib/utils/byte-units'; import { Icon, Text } from '@immich/ui'; - interface ValueData { + type ValueData = { value: number; unit?: ByteUnit | undefined; - } + }; interface Props { icon: string; @@ -38,7 +38,9 @@ {:then data}
{zeros(data)}{data.value} - {#if data.unit}{data.unit}{/if} + {#if data.unit} + {data.unit} + {/if}
{:catch _}
diff --git a/web/src/lib/components/server-statistics/ServerStatisticsPanel.svelte b/web/src/lib/components/server-statistics/ServerStatisticsPanel.svelte index 5b6e68db64..4cf2413d3e 100644 --- a/web/src/lib/components/server-statistics/ServerStatisticsPanel.svelte +++ b/web/src/lib/components/server-statistics/ServerStatisticsPanel.svelte @@ -49,8 +49,9 @@ return '0'.repeat(zeroLength); }; - const getUserStatsPromise = (userId: string) => { - return statsPromise.then((stats) => stats.usageByUser.find((userStats) => userStats.userId === userId)); + const getUserStatsPromise = async (userId: string) => { + const stats = await statsPromise; + return stats.usageByUser.find((userStats) => userStats.userId === userId); }; @@ -179,8 +180,6 @@ {:else} {@render placeholder()} {/if} - {:catch} - {@render placeholder()} {/await} {/each} diff --git a/web/src/routes/admin/library-management/(list)/+layout.svelte b/web/src/routes/admin/library-management/(list)/+layout.svelte index 4a89bf0b07..9db1446fb5 100644 --- a/web/src/routes/admin/library-management/(list)/+layout.svelte +++ b/web/src/routes/admin/library-management/(list)/+layout.svelte @@ -1,5 +1,5 @@