File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -88,15 +88,19 @@ const DatacapAmountModal = ({
88
88
} ,
89
89
[ setAllocationConfig ] ,
90
90
)
91
- const isAllocationAmountValid =
91
+ const isAllocationAmountInvalid =
92
92
! allocationConfig . amount || allocationConfig . amount === '0'
93
- const isEarlyRefillCommentValid =
93
+ const isEarlyRefillCommentNotNeeded =
94
+ allocationConfig . earlyRefillComment === undefined &&
95
+ usedDatatapInPercentage >= 75
96
+ const isEarlyRefillCommentInvalid =
94
97
allocationConfig . earlyRefillComment !== undefined &&
95
- allocationConfig . earlyRefillComment . length < 10 &&
98
+ allocationConfig ? .earlyRefillComment ? .length < 10 &&
96
99
usedDatatapInPercentage < 75
97
100
const isSubmitDisabled =
98
- isApiCalling || isAllocationAmountValid || isEarlyRefillCommentValid
99
-
101
+ isApiCalling ||
102
+ isAllocationAmountInvalid ||
103
+ ( isEarlyRefillCommentInvalid && ! isEarlyRefillCommentNotNeeded )
100
104
return (
101
105
< Dialog open = { allocationConfig . isDialogOpen } onClose = { onClose } fullWidth >
102
106
< DialogTitle > { title } </ DialogTitle >
You can’t perform that action at this time.
0 commit comments