Skip to content

Refactor credit runout calculation and simplify related logic#1351

Open
simbabimba-dev wants to merge 7 commits into
Ctrlpanel-gg:developmentfrom
simbabimba-dev:development
Open

Refactor credit runout calculation and simplify related logic#1351
simbabimba-dev wants to merge 7 commits into
Ctrlpanel-gg:developmentfrom
simbabimba-dev:development

Conversation

@simbabimba-dev
Copy link
Copy Markdown
Collaborator

Very self explanatory, simplifies the credit runout estimate timer as it was before

Copilot AI review requested due to automatic review settings May 20, 2026 16:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Comment thread app/Http/Controllers/HomeController.php Outdated
Comment thread app/Http/Controllers/HomeController.php Outdated
Copy link
Copy Markdown
Collaborator

@MrWeez MrWeez left a comment

Choose a reason for hiding this comment

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

And general thing: previously message contained ranout date, but you're including value now. Doesn't make sense to show duplicate information. It should be either date or just text

Comment thread app/Http/Controllers/HomeController.php Outdated
@simbabimba-dev
Copy link
Copy Markdown
Collaborator Author

And general thing: previously message contained ranout date, but you're including value now. Doesn't make sense to show duplicate information. It should be either date or just text

resolved, i added the date instead
image

@simbabimba-dev simbabimba-dev requested a review from MrWeez May 24, 2026 03:20
@simbabimba-dev
Copy link
Copy Markdown
Collaborator Author

I have read and agree to the CLA.

@MrWeez
Copy link
Copy Markdown
Collaborator

MrWeez commented May 26, 2026

@simbabimba-dev have you checked all scenarios? Including when time left should display 1 day and x hours until ranout?

Copy link
Copy Markdown
Collaborator

@MrWeez MrWeez left a comment

Choose a reason for hiding this comment

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

Just one thing, otherwise LGTM

'unit' => 'minute',
'bg' => self::TIME_LEFT_BG_DANGER
];
return $hoursLeft < 1 ? __('You ran out of Credits') : strval($hoursLeft);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return $hoursLeft < 1 ? __('You ran out of Credits') : strval($hoursLeft);
return $hoursLeft < 1 ? __('You ran out of Credits') : strval(number_format($hoursLeft, 0));

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.

Incorrect Server Rental Expiry Estimation – Stuck at “41 Days” Regardless of User Credit

3 participants