Skip to content

Commit

Permalink
fix: renterd contract sets
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed Jan 5, 2024
1 parent e470c16 commit 7635e79
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/hip-crabs-scream.md
@@ -0,0 +1,5 @@
---
'renterd': minor
---

Fixed an issue displaying the contract sets column data on the contracts explorer.
8 changes: 4 additions & 4 deletions apps/renterd/contexts/contracts/columns.tsx
Expand Up @@ -87,19 +87,19 @@ export const columns: ContractsTableColumn[] = [
},
},
{
id: 'sets',
id: 'contractSets',
label: 'contract sets',
contentClassName: 'w-[120px]',
category: 'general',
render: ({ data: { sets }, context: { defaultSet } }) => {
if (!sets) {
render: ({ data: { contractSets }, context: { defaultSet } }) => {
if (!contractSets) {
return null
}
return (
<div className="flex flex-col items-center overflow-hidden h-full">
<ScrollArea>
<div className="flex min-h-full gap-1 flex-wrap py-2 items-center">
{sets.map((set) => {
{contractSets.map((set) => {
const isDefaultSet = defaultSet === set
return (
<Tooltip
Expand Down
2 changes: 1 addition & 1 deletion apps/renterd/contexts/contracts/index.tsx
Expand Up @@ -89,7 +89,7 @@ function useContractsMain() {
state: c.state,
hostIp: c.hostIP,
hostKey: c.hostKey,
sets: c.sets,
contractSets: c.contractSets,
location: geoHosts.find((h) => h.public_key === c.hostKey)?.location,
timeline: startTime,
startTime,
Expand Down
6 changes: 3 additions & 3 deletions apps/renterd/contexts/contracts/types.ts
Expand Up @@ -8,7 +8,7 @@ export type ContractData = {
hostKey: string
state: ContractState
location?: [number, number]
sets?: string[]
contractSets?: string[]
isRenewed: boolean
renewedFrom: string
timeline: number
Expand All @@ -30,7 +30,7 @@ export type ContractData = {
export type TableColumnId =
| 'actions'
| 'contractId'
| 'sets'
| 'contractSets'
| 'hostIp'
| 'hostKey'
| 'state'
Expand All @@ -45,7 +45,7 @@ export type TableColumnId =

export const columnsDefaultVisible: TableColumnId[] = [
'contractId',
'sets',
'contractSets',
'hostIp',
'hostKey',
'state',
Expand Down
2 changes: 1 addition & 1 deletion libs/react-renterd/src/siaTypes.ts
Expand Up @@ -151,7 +151,7 @@ export type Contract = {
id: string
hostIP: string
hostKey: string
sets?: string[]
contractSets?: string[]
proofHeight: number
revisionHeight: number
revisionNumber: number
Expand Down

0 comments on commit 7635e79

Please sign in to comment.