[FL-3831] Separate editing and renaming in iButton and LFRFID (#3735)

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Astra
2024-06-30 20:34:13 +09:00
committed by GitHub
parent 9a02e23dc7
commit 81e2736145
5 changed files with 45 additions and 3 deletions

View File

@@ -41,9 +41,17 @@ bool ibutton_scene_save_name_on_event(void* context, SceneManagerEvent event) {
iButton* ibutton = context;
bool consumed = false;
const bool is_new_file = furi_string_empty(ibutton->file_path);
if(event.type == SceneManagerEventTypeCustom) {
consumed = true;
if(event.event == iButtonCustomEventTextEditResult) {
if(!is_new_file) {
Storage* storage = furi_record_open(RECORD_STORAGE);
storage_simply_remove(storage, furi_string_get_cstr(ibutton->file_path));
furi_record_close(RECORD_STORAGE);
}
furi_string_printf(
ibutton->file_path,
"%s/%s%s",