fix(ui-new): the screen redraws when USB power comes or goes

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-10-07 21:49:59 +02:00
co-authored by Claude Sonnet 5.5
parent 6e13ad59ae
commit f396882768
@@ -3327,6 +3327,11 @@ void UITask::loop() {
if (curr) curr->poll();
// A cable plugged in or pulled out: redraw at once, so the bolt by the
// battery follows it instead of waiting for the screen's next refresh.
{ static bool ext = board.isExternalPowered();
const bool now = board.isExternalPowered();
if (now != ext) { ext = now; _next_refresh = 0; } }
if (_display != NULL && _display->isOn()) {
// Lock-screen password prompt