CLI: Fix missing cleanup for subghz chat on region restricted

frequencies
This commit is contained in:
WillyJL
2025-12-31 23:04:48 +01:00
parent 95401473f8
commit 42630e9130
2 changed files with 8 additions and 7 deletions

View File

@@ -941,6 +941,13 @@ static void subghz_cli_command_chat(PipeSide* pipe, FuriString* args) {
return;
}
}
if(!furi_hal_region_is_frequency_allowed(frequency)) {
printf(
"In your settings/region, only reception on this frequency (%lu) is allowed,\r\n"
"the actual operation of the application is not possible\r\n ",
frequency);
return;
}
subghz_devices_init();
const SubGhzDevice* device = subghz_cli_command_get_device(&device_ind);
if(!subghz_devices_is_frequency_valid(device, frequency)) {
@@ -950,13 +957,6 @@ static void subghz_cli_command_chat(PipeSide* pipe, FuriString* args) {
subghz_cli_radio_device_power_off();
return;
}
if(!furi_hal_region_is_frequency_allowed(frequency)) {
printf(
"In your settings/region, only reception on this frequency (%lu) is allowed,\r\n"
"the actual operation of the application is not possible\r\n ",
frequency);
return;
}
SubGhzChatWorker* subghz_chat = subghz_chat_worker_alloc(pipe);