Tune UX for context menus

Co-authored-by: max <max@zed.dev>
This commit is contained in:
Mikayla 2023-08-07 17:14:09 -07:00
parent bedf60b6b2
commit fa71de8842
No known key found for this signature in database
3 changed files with 56 additions and 21 deletions

View file

@ -165,17 +165,29 @@ impl UserStore {
});
current_user_tx.send(user).await.ok();
this.update(&mut cx, |_, cx| {
cx.notify();
});
}
}
Status::SignedOut => {
current_user_tx.send(None).await.ok();
if let Some(this) = this.upgrade(&cx) {
this.update(&mut cx, |this, _| this.clear_contacts()).await;
this.update(&mut cx, |this, cx| {
cx.notify();
this.clear_contacts()
})
.await;
}
}
Status::ConnectionLost => {
if let Some(this) = this.upgrade(&cx) {
this.update(&mut cx, |this, _| this.clear_contacts()).await;
this.update(&mut cx, |this, cx| {
cx.notify();
this.clear_contacts()
})
.await;
}
}
_ => {}