When importing config, keep Bluetooth on and defer rebooting until co… (#4898)

* When importing config, keep Bluetooth on and defer rebooting until config is committed

* One more place that was prematurely disabling Bluetooth

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
dahanc 2024-09-29 07:30:10 -05:00 committed by GitHub
parent 403e5c304e
commit d41d4c930e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -583,7 +583,7 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c)
break;
}
if (requiresReboot) {
if (requiresReboot && !hasOpenEditTransaction) {
disableBluetooth();
}
@ -592,6 +592,7 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c)
void AdminModule::handleSetModuleConfig(const meshtastic_ModuleConfig &c)
{
if (!hasOpenEditTransaction)
disableBluetooth();
switch (c.which_payload_variant) {
case meshtastic_ModuleConfig_mqtt_tag:
@ -966,7 +967,7 @@ void AdminModule::saveChanges(int saveWhat, bool shouldReboot)
} else {
LOG_INFO("Delaying save of changes to disk until the open transaction is committed\n");
}
if (shouldReboot) {
if (shouldReboot && !hasOpenEditTransaction) {
reboot(DEFAULT_REBOOT_SECONDS);
}
}