From a846f6c610284ecfe8588d4685f4aaaec1d15127 Mon Sep 17 00:00:00 2001 From: Jeremy Lin Date: Sun, 26 Jul 2020 16:19:47 -0700 Subject: [PATCH] Fix soft delete notifications A soft-deleted entry should now show up in the trash folder immediately (previously, an extra sync was required). --- src/api/core/ciphers.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api/core/ciphers.rs b/src/api/core/ciphers.rs index 0180266..7ea2dbe 100644 --- a/src/api/core/ciphers.rs +++ b/src/api/core/ciphers.rs @@ -999,11 +999,12 @@ fn _delete_cipher_by_uuid(uuid: &str, headers: &Headers, conn: &DbConn, soft_del if soft_delete { cipher.deleted_at = Some(chrono::Utc::now().naive_utc()); cipher.save(&conn)?; + nt.send_cipher_update(UpdateType::CipherUpdate, &cipher, &cipher.update_users_revision(&conn)); } else { cipher.delete(&conn)?; + nt.send_cipher_update(UpdateType::CipherDelete, &cipher, &cipher.update_users_revision(&conn)); } - nt.send_cipher_update(UpdateType::CipherDelete, &cipher, &cipher.update_users_revision(&conn)); Ok(()) }