mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
client: Clear plan and usage information when signing out (#42678)
This PR makes it so we clear the user's plan and usage information when they sign out. Release Notes: - Signing out will now clear the local cache containing the plan and usage information.
This commit is contained in:
parent
3c577ba019
commit
e80b490ac0
1 changed files with 7 additions and 0 deletions
|
|
@ -267,6 +267,7 @@ impl UserStore {
|
|||
Status::SignedOut => {
|
||||
current_user_tx.send(None).await.ok();
|
||||
this.update(cx, |this, cx| {
|
||||
this.clear_plan_and_usage();
|
||||
cx.emit(Event::PrivateUserInfoUpdated);
|
||||
cx.notify();
|
||||
this.clear_contacts()
|
||||
|
|
@ -779,6 +780,12 @@ impl UserStore {
|
|||
cx.notify();
|
||||
}
|
||||
|
||||
pub fn clear_plan_and_usage(&mut self) {
|
||||
self.plan_info = None;
|
||||
self.model_request_usage = None;
|
||||
self.edit_prediction_usage = None;
|
||||
}
|
||||
|
||||
fn update_authenticated_user(
|
||||
&mut self,
|
||||
response: GetAuthenticatedUserResponse,
|
||||
|
|
|
|||
Loading…
Reference in a new issue