Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Remove email address from local database if user removes it

Joseph T. Lyons57a9f024e7e8
diff --git a/crates/feedback2/src/feedback_modal.rs b/crates/feedback2/src/feedback_modal.rs
index 626811dff85..52eca7b7f9d 100644
--- a/crates/feedback2/src/feedback_modal.rs
+++ b/crates/feedback2/src/feedback_modal.rs
@@ -152,11 +152,18 @@ impl FeedbackModal {
cx.spawn(|this, mut cx| async move {
let answer = answer.await.ok();
if answer == Some(0) {
- if let Some(email) = email.clone() {
- let _ = KEY_VALUE_STORE
- .write_kvp(DATABASE_KEY_NAME.to_string(), email)
- .await;
- }
+ match email.clone() {
+ Some(email) => {
+ let _ = KEY_VALUE_STORE
+ .write_kvp(DATABASE_KEY_NAME.to_string(), email)
+ .await;
+ }
+ None => {
+ let _ = KEY_VALUE_STORE
+ .delete_kvp(DATABASE_KEY_NAME.to_string())
+ .await;
+ }
+ };
this.update(&mut cx, |feedback_editor, cx| {
feedback_editor.set_pending_submission(true, cx);