subghz raw erase fixes

by @Willy-JL
This commit is contained in:
MX
2024-01-30 23:32:41 +03:00
parent c31052848a
commit 289fbe56be
2 changed files with 13 additions and 1 deletions

View File

@@ -144,6 +144,11 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
if((subghz_rx_key_state_get(subghz) == SubGhzRxKeyStateAddKey) ||
(subghz_rx_key_state_get(subghz) == SubGhzRxKeyStateBack)) {
subghz_rx_key_state_set(subghz, SubGhzRxKeyStateExit);
if(subghz_scene_read_raw_update_filename(subghz)) {
furi_string_set(subghz->file_path_tmp, subghz->file_path);
} else {
furi_string_reset(subghz->file_path_tmp);
}
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneNeedSaving);
} else {
//Restore default setting
@@ -178,7 +183,8 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
break;
case SubGhzCustomEventViewReadRAWErase:
if(subghz_rx_key_state_get(subghz) == SubGhzRxKeyStateAddKey) {
if((subghz_rx_key_state_get(subghz) == SubGhzRxKeyStateAddKey) ||
(subghz_rx_key_state_get(subghz) == SubGhzRxKeyStateBack)) {
if(subghz_scene_read_raw_update_filename(subghz)) {
furi_string_set(subghz->file_path_tmp, subghz->file_path);
subghz_delete_file(subghz);