[FL-2165] Do not allow "write" for keys that do not have write ability. #1055

This commit is contained in:
SG 2022-03-25 21:10:49 +10:00 committed by GitHub
parent 2ba3a9f09a
commit 76f524d4e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -16,7 +16,9 @@ void iButtonSceneReadedKeyMenu::on_enter(iButtonApp* app) {
Submenu* submenu = view_manager->get_submenu();
auto callback = cbc::obtain_connector(this, &iButtonSceneReadedKeyMenu::submenu_callback);
submenu_add_item(submenu, "Write", SubmenuIndexWrite, callback, app);
if(app->get_key()->get_key_type() == iButtonKeyType::KeyDallas) {
submenu_add_item(submenu, "Write", SubmenuIndexWrite, callback, app);
}
submenu_add_item(submenu, "Name and save", SubmenuIndexNameAndSave, callback, app);
submenu_add_item(submenu, "Emulate", SubmenuIndexEmulate, callback, app);
submenu_add_item(submenu, "Read new key", SubmenuIndexReadNewKey, callback, app);

View File

@ -18,7 +18,9 @@ void iButtonSceneSavedKeyMenu::on_enter(iButtonApp* app) {
auto callback = cbc::obtain_connector(this, &iButtonSceneSavedKeyMenu::submenu_callback);
submenu_add_item(submenu, "Emulate", SubmenuIndexEmulate, callback, app);
submenu_add_item(submenu, "Write", SubmenuIndexWrite, callback, app);
if(app->get_key()->get_key_type() == iButtonKeyType::KeyDallas) {
submenu_add_item(submenu, "Write", SubmenuIndexWrite, callback, app);
}
submenu_add_item(submenu, "Edit", SubmenuIndexEdit, callback, app);
submenu_add_item(submenu, "Delete", SubmenuIndexDelete, callback, app);
submenu_add_item(submenu, "Info", SubmenuIndexInfo, callback, app);