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
co-authored by Ben Meadors
parent 403e5c304e
commit d41d4c930e
+3 -2
View File
@@ -583,7 +583,7 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c)
break; break;
} }
if (requiresReboot) { if (requiresReboot && !hasOpenEditTransaction) {
disableBluetooth(); disableBluetooth();
} }
@@ -592,6 +592,7 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c)
void AdminModule::handleSetModuleConfig(const meshtastic_ModuleConfig &c) void AdminModule::handleSetModuleConfig(const meshtastic_ModuleConfig &c)
{ {
if (!hasOpenEditTransaction)
disableBluetooth(); disableBluetooth();
switch (c.which_payload_variant) { switch (c.which_payload_variant) {
case meshtastic_ModuleConfig_mqtt_tag: case meshtastic_ModuleConfig_mqtt_tag:
@@ -966,7 +967,7 @@ void AdminModule::saveChanges(int saveWhat, bool shouldReboot)
} else { } else {
LOG_INFO("Delaying save of changes to disk until the open transaction is committed\n"); LOG_INFO("Delaying save of changes to disk until the open transaction is committed\n");
} }
if (shouldReboot) { if (shouldReboot && !hasOpenEditTransaction) {
reboot(DEFAULT_REBOOT_SECONDS); reboot(DEFAULT_REBOOT_SECONDS);
} }
} }