mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-11 00:10:40 +00:00
Fix(cloud)/pricing annual misc (#7701)
## Summary Fix: PricingTable showed "Current Plan" on the wrong billing cycle (e.g., showing it on Yearly when subscribed to Monthly) because we weren't checking subscription_duration. Now we check for ANNUAL | MONTHLY match. Fix: Subscribed users were being sent to billing portal instead of checkout. Now routes to checkout. Improved: Types now use openapi.yml as source of truth. Tier names in user popover and subscription panels now reflect the billing cycle (YEARLY/MONTHLY). Recommended to merge this before https://github.com/Comfy-Org/ComfyUI_frontend/pull/7692 --------- Co-authored-by: bymyself <cbyrne@comfy.org>
This commit is contained in:
@@ -365,9 +365,9 @@ import { useSubscriptionCredits } from '@/platform/cloud/subscription/composable
|
||||
import { useSubscriptionDialog } from '@/platform/cloud/subscription/composables/useSubscriptionDialog'
|
||||
import {
|
||||
DEFAULT_TIER_KEY,
|
||||
TIER_FEATURES,
|
||||
TIER_TO_KEY,
|
||||
getTierCredits,
|
||||
getTierFeatures,
|
||||
getTierPrice
|
||||
} from '@/platform/cloud/subscription/constants/tierPricing'
|
||||
import { cn } from '@/utils/tailwindUtil'
|
||||
@@ -383,6 +383,7 @@ const {
|
||||
formattedEndDate,
|
||||
subscriptionTier,
|
||||
subscriptionTierName,
|
||||
isYearlySubscription,
|
||||
handleInvoiceHistory
|
||||
} = useSubscription()
|
||||
|
||||
@@ -393,7 +394,9 @@ const tierKey = computed(() => {
|
||||
if (!tier) return DEFAULT_TIER_KEY
|
||||
return TIER_TO_KEY[tier] ?? DEFAULT_TIER_KEY
|
||||
})
|
||||
const tierPrice = computed(() => getTierPrice(tierKey.value))
|
||||
const tierPrice = computed(() =>
|
||||
getTierPrice(tierKey.value, isYearlySubscription.value)
|
||||
)
|
||||
|
||||
// Tier benefits for v-for loop
|
||||
type BenefitType = 'metric' | 'feature'
|
||||
@@ -433,7 +436,7 @@ const tierBenefits = computed((): Benefit[] => {
|
||||
}
|
||||
]
|
||||
|
||||
if (TIER_FEATURES[key].customLoRAs) {
|
||||
if (getTierFeatures(key).customLoRAs) {
|
||||
benefits.push({
|
||||
key: 'customLoRAs',
|
||||
type: 'feature',
|
||||
|
||||
Reference in New Issue
Block a user