From 8be3f48f3732e1e9027598ac283f8f3082e8c5c0 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 31 Jul 2025 23:10:16 -0400 Subject: [PATCH] client: Remove unused `subscription_period` from `UserStore` (#35454) This PR removes the `subscription_period` field from the `UserStore`, as its usage has been replaced by the `CloudUserStore`. Release Notes: - N/A --- crates/client/src/user.rs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/crates/client/src/user.rs b/crates/client/src/user.rs index dc762efa5d..82fc7f4713 100644 --- a/crates/client/src/user.rs +++ b/crates/client/src/user.rs @@ -20,7 +20,7 @@ use std::{ sync::{Arc, Weak}, }; use text::ReplicaId; -use util::{TryFutureExt as _, maybe}; +use util::TryFutureExt as _; pub type UserId = u64; @@ -111,7 +111,6 @@ pub struct UserStore { participant_indices: HashMap, update_contacts_tx: mpsc::UnboundedSender, current_plan: Option, - subscription_period: Option<(DateTime, DateTime)>, trial_started_at: Option>, is_usage_based_billing_enabled: Option, account_too_young: Option, @@ -188,7 +187,6 @@ impl UserStore { by_github_login: Default::default(), current_user: current_user_rx, current_plan: None, - subscription_period: None, trial_started_at: None, is_usage_based_billing_enabled: None, account_too_young: None, @@ -354,13 +352,6 @@ impl UserStore { ) -> Result<()> { this.update(&mut cx, |this, cx| { this.current_plan = Some(message.payload.plan()); - this.subscription_period = maybe!({ - let period = message.payload.subscription_period?; - let started_at = DateTime::from_timestamp(period.started_at as i64, 0)?; - let ended_at = DateTime::from_timestamp(period.ended_at as i64, 0)?; - - Some((started_at, ended_at)) - }); this.trial_started_at = message .payload .trial_started_at @@ -747,10 +738,6 @@ impl UserStore { self.current_plan } - pub fn subscription_period(&self) -> Option<(DateTime, DateTime)> { - self.subscription_period - } - pub fn trial_started_at(&self) -> Option> { self.trial_started_at }