Gate screen code behind IF_SCREEN()

This commit is contained in:
Jonathan Bennett 2025-07-10 10:20:44 -05:00
parent 107dec22bd
commit 74c735d5fb

View File

@ -84,11 +84,10 @@ bool KeyVerificationModule::handleReceivedProtobuf(const meshtastic_MeshPacket &
memset(message, 0, sizeof(message)); memset(message, 0, sizeof(message));
sprintf(message, "Verification: \n"); sprintf(message, "Verification: \n");
generateVerificationCode(message + 15); generateVerificationCode(message + 15);
static const char *optionsArray[] = {"Reject", "Accept"};
LOG_INFO("Hash1 matches!"); LOG_INFO("Hash1 matches!");
IF_SCREEN(graphics::BannerOverlayOptions options; options.message = message; options.durationMs = 30000; IF_SCREEN(static const char *optionsArray[] = {"Reject", "Accept"}; graphics::BannerOverlayOptions options;
options.optionsArrayPtr = optionsArray; options.optionsCount = 2; options.message = message; options.durationMs = 30000; options.optionsArrayPtr = optionsArray;
options.notificationType = graphics::notificationTypeEnum::selection_picker; options.optionsCount = 2; options.notificationType = graphics::notificationTypeEnum::selection_picker;
options.bannerCallback = options.bannerCallback =
[=](int selected) { [=](int selected) {
if (selected == 1) { if (selected == 1) {
@ -121,7 +120,7 @@ bool KeyVerificationModule::sendInitialRequest(NodeNum remoteNode)
// generate nonce // generate nonce
updateState(); updateState();
if (currentState != KEY_VERIFICATION_IDLE) { if (currentState != KEY_VERIFICATION_IDLE) {
graphics::menuHandler::menuQueue = graphics::menuHandler::throttle_message; IF_SCREEN(graphics::menuHandler::menuQueue = graphics::menuHandler::throttle_message;)
return false; return false;
} }
currentNonce = random(); currentNonce = random();