This commit is contained in:
John Crawford 2024-08-06 16:37:40 +01:00 committed by GitHub
commit c5f2c48422
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -447,7 +447,16 @@ void DisplayApp::Refresh() {
break; break;
case Messages::OnChargingEvent: case Messages::OnChargingEvent:
RestoreBrightness(); RestoreBrightness();
motorController.RunForDuration(15); if (batteryController.IsCharging() && currentApp == Apps::Clock) {
// Open the battery app if on the clock screen
LoadNewScreen(Apps::BatteryInfo, DisplayApp::FullRefreshDirections::None);
} else if (!batteryController.IsCharging() && currentApp == Apps::BatteryInfo) {
// Close the battery app after being unplugged
LoadNewScreen(Apps::Clock, DisplayApp::FullRefreshDirections::None);
} else {
// Vibrate normally otherwise as to not close any open app
motorController.RunForDuration(15);
}
break; break;
} }
} }