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

Commit

Permalink
Add back nfc dynamic default save name to new app
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Nov 12, 2023
1 parent 692d1a7 commit 1bbf424
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,15 @@ static void nfc_protocol_support_scene_save_name_on_enter(NfcApp* instance) {
bool name_is_empty = furi_string_empty(instance->file_name);
if(name_is_empty) {
furi_string_set(instance->file_path, NFC_APP_FOLDER);
FuriString* prefix = furi_string_alloc_set(
nfc_device_get_name(instance->nfc_device, NfcDeviceNameTypeShort));
furi_string_replace(prefix, "Mifare", "MF");
furi_string_replace(prefix, "Ultralight", "UL");
furi_string_replace(prefix, " Plus", "+");
furi_string_replace_all(prefix, " ", "_");
name_generator_make_auto(
instance->text_store, NFC_TEXT_STORE_SIZE, NFC_APP_FILENAME_PREFIX);
instance->text_store, NFC_TEXT_STORE_SIZE, furi_string_get_cstr(prefix));
furi_string_free(prefix);
furi_string_set(folder_path, NFC_APP_FOLDER);
} else {
nfc_text_store_set(instance, "%s", furi_string_get_cstr(instance->file_name));
Expand Down

0 comments on commit 1bbf424

Please sign in to comment.