Skip to content

Commit a053ced

Browse files
committed
Prepare allocator tech for the new JSON
1 parent da18c99 commit a053ced

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

src/app/application/[owner]/[repo]/[id]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const ApplicationDetailPage: React.FC<ComponentProps> = ({
7676
void getAllowanceClassic(selectedAllocator.multisig_address)
7777
} else {
7878
void getAllowanceSmartContract(
79-
selectedAllocator.address,
79+
selectedAllocator.ma_address ?? selectedAllocator.address,
8080
selectedAllocator.multisig_address,
8181
)
8282
}

src/components/AllocatorBalance.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const AllocatorBalance: React.FC<ComponentProps> = ({ owner, repo }) => {
7474
.split(', ')
7575
.includes('smart_contract_allocator')
7676
void fetchBalance(
77-
allocator.address,
77+
allocator.ma_address ?? allocator.address,
7878
allocator.multisig_address,
7979
isMetaallocatorContract,
8080
)

src/components/DatacapAmountModel.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,16 @@ const DatacapAmountModal = ({
9090
)
9191
const isAllocationAmountInvalid =
9292
!allocationConfig.amount || allocationConfig.amount === '0'
93-
const isEarlyRefillCommentNotNeeded =
94-
allocationConfig.earlyRefillComment === undefined &&
95-
usedDatatapInPercentage >= 75
96-
const isEarlyRefillCommentInvalid =
97-
allocationConfig.earlyRefillComment !== undefined &&
98-
allocationConfig?.earlyRefillComment?.length < 10 &&
99-
usedDatatapInPercentage < 75
93+
const isEarlyRefillCommentNeeded =
94+
usedDatatapInPercentage < 75 && application?.Lifecycle?.State === 'Granted'
95+
const isEarlyRefillCommentValid =
96+
allocationConfig.earlyRefillComment &&
97+
allocationConfig?.earlyRefillComment?.length >= 10
10098
const isSubmitDisabled =
10199
isApiCalling ||
102100
isAllocationAmountInvalid ||
103-
(isEarlyRefillCommentInvalid && !isEarlyRefillCommentNotNeeded)
101+
(!isEarlyRefillCommentValid && isEarlyRefillCommentNeeded)
102+
104103
return (
105104
<Dialog open={allocationConfig.isDialogOpen} onClose={onClose} fullWidth>
106105
<DialogTitle>{title}</DialogTitle>

src/hooks/useApplicationActions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ const useApplicationActions = (
538538
allocatorType,
539539
contractAddress:
540540
typeof selectedAllocator !== 'string'
541-
? selectedAllocator?.address ?? ''
541+
? selectedAllocator?.ma_address ?? selectedAllocator?.address ?? ''
542542
: '',
543543
clientAddress: addressToGrantDataCap,
544544
proposalAllocationAmount,

src/type.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ export interface Allocator {
211211
tooling: string | null
212212
verifiers_gh_handles: string | string[]
213213
client_contract_address: string | null
214+
ma_address: string | null
214215
}
215216

216217
export enum AllocatorTypeEnum {

0 commit comments

Comments
 (0)