Skip to content

Commit 94443e7

Browse files
committed
Update nfc_playlist_scene_file_rename.c
1 parent 198b9ce commit 94443e7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

scenes/nfc_playlist_scene_file_rename.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,17 @@ void nfc_playlist_file_rename_menu_callback(void* context) {
1212
furi_string_cat_str(new_file_path, ".txt");
1313
char const* new_file_path_cstr = furi_string_get_cstr(new_file_path);
1414

15-
if(!storage_file_exists(storage, new_file_path_cstr)) {
16-
storage_common_rename(storage, furi_string_get_cstr(nfc_playlist->settings.file_path), new_file_path_cstr);
15+
if (storage_common_rename_safe(storage, furi_string_get_cstr(nfc_playlist->settings.file_path), new_file_path_cstr) == 0) {
1716
furi_string_free(nfc_playlist->settings.file_path);
1817
nfc_playlist->settings.file_path = furi_string_alloc_set_str(new_file_path_cstr);
1918
}
2019

20+
// if (!storage_file_exists(storage, new_file_path_cstr)) {
21+
// storage_common_rename(storage, furi_string_get_cstr(nfc_playlist->settings.file_path), new_file_path_cstr);
22+
// furi_string_free(nfc_playlist->settings.file_path);
23+
// nfc_playlist->settings.file_path = furi_string_alloc_set_str(new_file_path_cstr);
24+
// }
25+
2126
furi_record_close(RECORD_STORAGE);
2227
furi_string_free(new_file_path);
2328

0 commit comments

Comments
 (0)