From e80b490ac00bfb5c206d3eb3f5c2dec10e742678 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 13 Nov 2025 18:13:27 -0500 Subject: [PATCH] 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. --- crates/client/src/user.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/client/src/user.rs b/crates/client/src/user.rs index 525a3e960ce8bc2aede4b0665af23ab3c33cac15..37f0f3ec278d28279e8d75f5c0b64c75f69901bb 100644 --- a/crates/client/src/user.rs +++ b/crates/client/src/user.rs @@ -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,