From a3b3fb8134e7dfdd94e31c09a7ed5c834c56921b Mon Sep 17 00:00:00 2001 From: Alex Freska Date: Wed, 17 Jan 2024 14:57:47 -0800 Subject: [PATCH] fix: renterd hide 0 file health --- .changeset/cool-walls-jam.md | 5 +++++ .../components/Files/FilesStatsMenu/FilesStatsMenuHealth.tsx | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/cool-walls-jam.md diff --git a/.changeset/cool-walls-jam.md b/.changeset/cool-walls-jam.md new file mode 100644 index 000000000..0a7526015 --- /dev/null +++ b/.changeset/cool-walls-jam.md @@ -0,0 +1,5 @@ +--- +'renterd': minor +--- + +The file stats now only show health once there is more than 0 bytes of file data. diff --git a/apps/renterd/components/Files/FilesStatsMenu/FilesStatsMenuHealth.tsx b/apps/renterd/components/Files/FilesStatsMenu/FilesStatsMenuHealth.tsx index 3f72d1b30..4fde0cb82 100644 --- a/apps/renterd/components/Files/FilesStatsMenu/FilesStatsMenuHealth.tsx +++ b/apps/renterd/components/Files/FilesStatsMenu/FilesStatsMenuHealth.tsx @@ -20,7 +20,8 @@ export function FilesStatsMenuHealth() { isDirectory: true, }) - if (!stats.data) { + const noDataYet = stats.data?.totalObjectsSize === 0 + if (!stats.data || noDataYet) { return null }