Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

Commit

Permalink
Fix read raw not deleting on discard (#537)
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Jan 28, 2024
1 parent 842c9a2 commit 280e904
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions applications/main/subghz/scenes/subghz_scene_need_saving.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ bool subghz_scene_need_saving_on_event(void* context, SceneManagerEvent event) {
subghz_rx_key_state_set(subghz, SubGhzRxKeyStateIDLE);

if(state == SubGhzRxKeyStateExit) {
if(scene_manager_has_previous_scene(subghz->scene_manager, SubGhzSceneReadRAW)) {
if(!furi_string_empty(subghz->file_path_tmp)) {
subghz_delete_file(subghz);
}
}
subghz_txrx_set_preset(
subghz->txrx, "AM650", subghz->last_settings->frequency, 0, 0, NULL, 0);
scene_manager_search_and_switch_to_previous_scene(
Expand Down
5 changes: 5 additions & 0 deletions applications/main/subghz/scenes/subghz_scene_read_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,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
Expand Down

0 comments on commit 280e904

Please sign in to comment.