Skip to content

Commit

Permalink
Fix the power applet battery status when the seconds var is 3600 (lin…
Browse files Browse the repository at this point in the history
…uxmint#11931)

In the edgecase of the charge/discharge seconds var being the magic
number 3600, the power applet will erroneously report
"0 minutes remaining", as the conditional statement will not take
exactly 1 hour into account, with the time var equaling 60.

This commit fixes issue linuxmint#11930
  • Loading branch information
victordejong authored Nov 22, 2023
1 parent f4884e4 commit 379013e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions files/usr/share/cinnamon/applets/power@cinnamon.org/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ class CinnamonPowerApplet extends Applet.TextIconApplet {
if (time == 0) {
status = _("Charging");
}
else if (time > 60) {
else if (time >= 60) {
if (minutes == 0) {
status = ngettext("Charging - %d hour until fully charged", "Charging - %d hours until fully charged", hours).format(hours);
}
Expand All @@ -455,7 +455,7 @@ class CinnamonPowerApplet extends Applet.TextIconApplet {
if (time == 0) {
status = _("Using battery power");
}
else if (time > 60) {
else if (time >= 60) {
if (minutes == 0) {
status = ngettext("Using battery power - %d hour remaining", "Using battery power - %d hours remaining", hours).format(hours);
}
Expand Down

0 comments on commit 379013e

Please sign in to comment.