Skip to content

Commit 984ed75

Browse files
committed
fix: renterd file health stats popover
1 parent 9deee11 commit 984ed75

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.changeset/heavy-geese-train.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'renterd': patch
3+
---
4+
5+
Fixed an issue where hovering over the file health information would crash the app. Closes https://github.com/SiaFoundation/renterd/issues/997

apps/renterd/components/Files/Columns/FilesHealthColumn/FilesHealthColumnContents.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ export function FilesHealthColumnContents({
5555
}
5656

5757
const slabs = sortBy(
58-
obj.data.object.slabs.map((s) => ({
58+
obj.data.object.slabs?.map((s) => ({
5959
...s.slab,
60+
key: `${s.offset}${s.length}${s.slab.key}`,
6061
isPartialSlab: !!s.slab.shards,
6162
contractSetShards: s.slab.shards?.length
6263
? computeSlabContractSetShards({
@@ -65,7 +66,7 @@ export function FilesHealthColumnContents({
6566
health: s.slab.health,
6667
})
6768
: 0,
68-
})),
69+
})) || [],
6970
'contractSetShards'
7071
)
7172

0 commit comments

Comments
 (0)