Skip to content

Commit

Permalink
fix(renterd): files copy metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed Dec 19, 2024
1 parent 372dd22 commit d127f07
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/silver-pants-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'renterd': patch
---

Fixed an issue with the copy file metadata action in the file context menu.
5 changes: 5 additions & 0 deletions .changeset/thick-geckos-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@siafoundation/renterd-types': minor
---

The object response has been updated in v2.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function FilesHealthColumnContents({
)
}

if (!obj.data?.object) {
if (!obj.data) {
return (
<Layout displayHealth={displayHealth} label={label}>
<Text size="12">Error fetching slab metadata.</Text>
Expand All @@ -56,7 +56,7 @@ export function FilesHealthColumnContents({
}

const slabs = sortBy(
obj.data.object.slabs?.map((s) => ({
obj.data.slabs?.map((s) => ({
...s.slab,
// id is for use as a unique React key.
// slab key is not necessarily unique. e.g. an object uploaded with tiny
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ export function CopyMetadataMenuItem({ path }: Props) {
disabled={!obj.data}
onSelect={() => {
if (obj.data) {
copyToClipboard(
JSON.stringify(obj.data.object, null, 2),
'object metadata'
)
copyToClipboard(JSON.stringify(obj.data, null, 2), 'object metadata')
}
}}
>
Expand Down
2 changes: 1 addition & 1 deletion libs/renterd-types/src/bus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ export type ObjectsResponse = {

export type ObjectParams = { key: string; bucket: string }
export type ObjectPayload = void
export type ObjectResponse = { object: Obj }
export type ObjectResponse = Obj

export type ObjectAddParams = { key: string; bucket: string }
export type ObjectAddPayload = {
Expand Down

0 comments on commit d127f07

Please sign in to comment.