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
This commit is contained in:
parent
76a8293cc6
commit
8be3f48f37
1 changed files with 1 additions and 14 deletions
|
@ -20,7 +20,7 @@ use std::{
|
||||||
sync::{Arc, Weak},
|
sync::{Arc, Weak},
|
||||||
};
|
};
|
||||||
use text::ReplicaId;
|
use text::ReplicaId;
|
||||||
use util::{TryFutureExt as _, maybe};
|
use util::TryFutureExt as _;
|
||||||
|
|
||||||
pub type UserId = u64;
|
pub type UserId = u64;
|
||||||
|
|
||||||
|
@ -111,7 +111,6 @@ pub struct UserStore {
|
||||||
participant_indices: HashMap<u64, ParticipantIndex>,
|
participant_indices: HashMap<u64, ParticipantIndex>,
|
||||||
update_contacts_tx: mpsc::UnboundedSender<UpdateContacts>,
|
update_contacts_tx: mpsc::UnboundedSender<UpdateContacts>,
|
||||||
current_plan: Option<proto::Plan>,
|
current_plan: Option<proto::Plan>,
|
||||||
subscription_period: Option<(DateTime<Utc>, DateTime<Utc>)>,
|
|
||||||
trial_started_at: Option<DateTime<Utc>>,
|
trial_started_at: Option<DateTime<Utc>>,
|
||||||
is_usage_based_billing_enabled: Option<bool>,
|
is_usage_based_billing_enabled: Option<bool>,
|
||||||
account_too_young: Option<bool>,
|
account_too_young: Option<bool>,
|
||||||
|
@ -188,7 +187,6 @@ impl UserStore {
|
||||||
by_github_login: Default::default(),
|
by_github_login: Default::default(),
|
||||||
current_user: current_user_rx,
|
current_user: current_user_rx,
|
||||||
current_plan: None,
|
current_plan: None,
|
||||||
subscription_period: None,
|
|
||||||
trial_started_at: None,
|
trial_started_at: None,
|
||||||
is_usage_based_billing_enabled: None,
|
is_usage_based_billing_enabled: None,
|
||||||
account_too_young: None,
|
account_too_young: None,
|
||||||
|
@ -354,13 +352,6 @@ impl UserStore {
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
this.update(&mut cx, |this, cx| {
|
this.update(&mut cx, |this, cx| {
|
||||||
this.current_plan = Some(message.payload.plan());
|
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
|
this.trial_started_at = message
|
||||||
.payload
|
.payload
|
||||||
.trial_started_at
|
.trial_started_at
|
||||||
|
@ -747,10 +738,6 @@ impl UserStore {
|
||||||
self.current_plan
|
self.current_plan
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn subscription_period(&self) -> Option<(DateTime<Utc>, DateTime<Utc>)> {
|
|
||||||
self.subscription_period
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn trial_started_at(&self) -> Option<DateTime<Utc>> {
|
pub fn trial_started_at(&self) -> Option<DateTime<Utc>> {
|
||||||
self.trial_started_at
|
self.trial_started_at
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue