From 13402b99b9fe04273cbad5f6163130612f174e1f Mon Sep 17 00:00:00 2001 From: bunnie Date: Thu, 22 Sep 2022 22:05:57 +0800 Subject: [PATCH] fix #224 was a logic bug where the database name was not updated while doing some refactoring previously --- apps/vault/src/actions.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/vault/src/actions.rs b/apps/vault/src/actions.rs index 2ebbac336..2c90db7ec 100644 --- a/apps/vault/src/actions.rs +++ b/apps/vault/src/actions.rs @@ -440,14 +440,14 @@ impl ActionManager { if choice.is_none() { // we're dealing with FIDO stuff, use the custom code path - match self.pddb.borrow().get(crate::ctap::FIDO_CRED_DICT, entry.key_name.as_str().unwrap_or("UTF8-error"), + match self.pddb.borrow().get(U2F_APP_DICT, entry.key_name.as_str().unwrap_or("UTF8-error"), None, false, false, None, None:: ) { Ok(candidate) => { let attr = candidate.attributes().expect("couldn't get key attributes"); match self.pddb.borrow() .delete_key( - crate::ctap::FIDO_CRED_DICT, + U2F_APP_DICT, entry.key_name.as_str().unwrap_or("UTF8-error"), Some(&attr.basis) ) { @@ -461,12 +461,12 @@ impl ActionManager { self.report_err(t!("vault.error.not_found", xous::LANG), Some(e)); } } - } - - // we're deleting either a password, ora a totp - match self.storage.borrow_mut().delete(choice.unwrap(), entry.key_name.as_str().unwrap_or("UTF-8 error")) { - Ok(_) => self.modals.show_notification(t!("vault.completed", xous::LANG), None).ok().unwrap(), - Err(e) => self.report_err(t!("vault.error.internal_error", xous::LANG), Some(e)), + } else { + // we're deleting either a password, or a totp + match self.storage.borrow_mut().delete(choice.unwrap(), entry.key_name.as_str().unwrap_or("UTF-8 error")) { + Ok(_) => self.modals.show_notification(t!("vault.completed", xous::LANG), None).ok().unwrap(), + Err(e) => self.report_err(t!("vault.error.internal_error", xous::LANG), Some(e)), + } } } }