Skip to content

Commit

Permalink
fix: transaction details dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed Jun 4, 2024
1 parent f131751 commit 866641b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .changeset/shaggy-peas-sip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'hostd': patch
'renterd': patch
---

Fixed an issue where the transaction information would not show in the dialog. Closes https://github.com/SiaFoundation/hostd/issues/402
4 changes: 2 additions & 2 deletions apps/hostd/dialogs/HostdTransactionDetailsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useDialog } from '../contexts/dialog'
import { useTransactions } from '../contexts/transactions'

export function HostdTransactionDetailsDialog() {
const { id, dialog, openDialog, closeDialog } = useDialog()
const { id, dialog, onOpenChange } = useDialog()
const { dataset } = useTransactions()

const transaction = useMemo(() => {
Expand All @@ -16,7 +16,7 @@ export function HostdTransactionDetailsDialog() {
id={id}
transaction={transaction}
open={dialog === 'transactionDetails'}
onOpenChange={(val) => (val ? openDialog(dialog) : closeDialog())}
onOpenChange={onOpenChange}
/>
)
}
2 changes: 1 addition & 1 deletion apps/hostd/dialogs/VolumeDeleteDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function VolumeDeleteDialog({ trigger, open, onOpenChange }: Props) {

const volumeDelete = useVolumeDelete()
const volume = useVolume({
disabled: !id,
disabled: !open || !id,
params: {
id,
},
Expand Down
2 changes: 1 addition & 1 deletion apps/hostd/dialogs/VolumeResizeDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function VolumeResizeDialog({ trigger, open, onOpenChange }: Props) {
const { id } = useDialog()
const separator = useHostOSPathSeparator()
const volume = useVolume({
disabled: !id,
disabled: !open || !id,
params: {
id,
},
Expand Down
4 changes: 2 additions & 2 deletions apps/renterd/dialogs/RenterdTransactionDetailsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from '../contexts/transactions'

export function RenterdTransactionDetailsDialog() {
const { id, dialog, openDialog, closeDialog } = useDialog()
const { id, dialog, onOpenChange } = useDialog()

// TODO: add transaction endpoint
const { dataset } = useTransactions()
Expand All @@ -20,7 +20,7 @@ export function RenterdTransactionDetailsDialog() {
id={id}
transaction={transaction as TransactionDataConfirmed}
open={dialog === 'transactionDetails'}
onOpenChange={(val) => (val ? openDialog(dialog) : closeDialog())}
onOpenChange={onOpenChange}
/>
)
}

0 comments on commit 866641b

Please sign in to comment.