Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

collab: Only create a Zed Free subscription if there is no other active subscription (#31023)

Marshall Bowers110195cdaef8
diff --git a/crates/collab/src/stripe_billing.rs b/crates/collab/src/stripe_billing.rs
index 1af341261d8..13a1c758775 100644
--- a/crates/collab/src/stripe_billing.rs
+++ b/crates/collab/src/stripe_billing.rs
@@ -320,19 +320,15 @@ impl StripeBilling {
)
.await?;
- let existing_zed_free_subscription =
+ let existing_active_subscription =
existing_subscriptions
.data
.into_iter()
.find(|subscription| {
subscription.status == SubscriptionStatus::Active
- && subscription.items.data.iter().any(|item| {
- item.price
- .as_ref()
- .map_or(false, |price| price.id == zed_free_price_id)
- })
+ || subscription.status == SubscriptionStatus::Trialing
});
- if let Some(subscription) = existing_zed_free_subscription {
+ if let Some(subscription) = existing_active_subscription {
return Ok(subscription);
}