Skip to content

Commit

Permalink
Update useGetDelegationActions.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
alten-dturus committed Dec 20, 2024
1 parent e73d756 commit 9604424
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/hooks/useGetDelegationActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ export function useGetDelegationActions(delegation: Delegation | CompactDelegati
if (!delegation) return { actions: actions }

const handleAccept = () => {
openDialog({ type: 'acceptDelegation', delegationId: delegation.id })
openDialog({
type: 'acceptDelegation',
delegationId: delegation.id,
delegationKind: delegation.kind,
})
}

const acceptAction: ActionItemButton = {
Expand All @@ -27,7 +31,11 @@ export function useGetDelegationActions(delegation: Delegation | CompactDelegati
}

const handleReject = () => {
openDialog({ type: 'rejectDelegation', delegationId: delegation.id })
openDialog({
type: 'rejectDelegation',
delegationId: delegation.id,
delegationKind: delegation.kind,
})
}

const rejectAction: ActionItemButton = {
Expand All @@ -53,7 +61,6 @@ export function useGetDelegationActions(delegation: Delegation | CompactDelegati
}

if (
delegation.kind === 'DELEGATED_PRODUCER' &&
delegation.state === 'WAITING_FOR_APPROVAL' &&
delegation.delegate.id === jwt?.organizationId
) {
Expand Down

0 comments on commit 9604424

Please sign in to comment.