Skip to content

[FIL-146] Allow triggering refill even if less than 75% of the DataCap was used #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

Filip-L
Copy link
Collaborator

@Filip-L Filip-L commented May 28, 2025

Screenshot from 2025-05-28 14-54-36
Screenshot from 2025-05-28 14-58-36

@@ -222,6 +225,25 @@ const DatacapAmountModal = ({
</Box>
</div>
</div>
{usedDatatapInPercentage < 75 &&
remainingDatacap &&
remainingDatacap > 0 ? (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Kinda redundant, the line above will already return false when coerced to boolean for remainingDatacap equal to 0

rows={4}
variant="outlined"
fullWidth
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to useCallback

@@ -233,7 +255,14 @@ const DatacapAmountModal = ({
Cancel
</Button>
<Button
disabled={isApiCalling || !allocationConfig.amount}
disabled={
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be good idea to define a constant for readability reasons instead of inlining so many condition

@Filip-L Filip-L merged commit 53d50a4 into main May 28, 2025
6 checks passed
@Filip-L Filip-L deleted the FIL-146-allow-triggering-refill-even-if-less-than-75%-of-the-datacap-was-used branch May 28, 2025 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants