Skip to content

Commit

Permalink
Execute callback for ItemToggle after drawing; fixes forntoh#264
Browse files Browse the repository at this point in the history
  • Loading branch information
mriveralee committed Jan 4, 2025
1 parent 4b8a050 commit 4291de0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ItemToggle.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ class ItemToggle : public MenuItem {
};
void toggle(MenuRenderer* renderer) {
enabled = !enabled;
LOG(F("ItemToggle::toggle"), enabled ? textOn : textOff);
draw(renderer);
if (callback != NULL) {
callback(enabled);
}
LOG(F("ItemToggle::toggle"), enabled ? textOn : textOff);
draw(renderer);
}
};

Expand Down

0 comments on commit 4291de0

Please sign in to comment.