Fix ibutton app - add manually - duplicate names

This commit is contained in:
MX 2023-03-03 07:34:49 +03:00
parent 3bdd171ce2
commit 43ef3d9bff
No known key found for this signature in database
GPG Key ID: 7CCC66B7DBDD1C83

View File

@ -8,11 +8,20 @@ void ibutton_scene_add_type_on_enter(void* context) {
for(uint32_t protocol_id = 0; protocol_id < ibutton_protocols_get_protocol_count(); for(uint32_t protocol_id = 0; protocol_id < ibutton_protocols_get_protocol_count();
++protocol_id) { ++protocol_id) {
furi_string_printf( if((strcmp(
tmp, ibutton_protocols_get_manufacturer(ibutton->protocols, protocol_id),
"%s %s", ibutton_protocols_get_name(ibutton->protocols, protocol_id)) != 0) &&
ibutton_protocols_get_manufacturer(ibutton->protocols, protocol_id), (strcmp(ibutton_protocols_get_manufacturer(ibutton->protocols, protocol_id), "N/A") !=
ibutton_protocols_get_name(ibutton->protocols, protocol_id)); 0)) {
furi_string_printf(
tmp,
"%s %s",
ibutton_protocols_get_manufacturer(ibutton->protocols, protocol_id),
ibutton_protocols_get_name(ibutton->protocols, protocol_id));
} else {
furi_string_printf(
tmp, "%s", ibutton_protocols_get_name(ibutton->protocols, protocol_id));
}
submenu_add_item( submenu_add_item(
submenu, furi_string_get_cstr(tmp), protocol_id, ibutton_submenu_callback, context); submenu, furi_string_get_cstr(tmp), protocol_id, ibutton_submenu_callback, context);