From d3afe2b2926f14fc27825589d9cc9f9d41b64f91 Mon Sep 17 00:00:00 2001 From: bymyself Date: Thu, 11 Dec 2025 01:10:30 -0800 Subject: [PATCH] fix: correct FOUNDERS_EDITION handling and polling behavior - Map FOUNDERS_EDITION to 'standard' tier for current plan display - Change polling to only start on window focus (when user returns from checkout) - Clean up event listeners properly in onBeforeUnmount - Improves UX by not polling immediately when dialog opens --- .../cloud/subscription/components/PricingTable.vue | 2 +- .../components/SubscriptionRequiredDialogContent.vue | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/platform/cloud/subscription/components/PricingTable.vue b/src/platform/cloud/subscription/components/PricingTable.vue index f8aa3eb6d..73b7d879e 100644 --- a/src/platform/cloud/subscription/components/PricingTable.vue +++ b/src/platform/cloud/subscription/components/PricingTable.vue @@ -145,7 +145,7 @@ const TIER_TO_KEY: Record = { STANDARD: 'standard', CREATOR: 'creator', PRO: 'pro', - FOUNDERS_EDITION: 'creator' + FOUNDERS_EDITION: 'standard' } const tiers: PricingTierConfig[] = [ diff --git a/src/platform/cloud/subscription/components/SubscriptionRequiredDialogContent.vue b/src/platform/cloud/subscription/components/SubscriptionRequiredDialogContent.vue index 688208f23..43e6a2295 100644 --- a/src/platform/cloud/subscription/components/SubscriptionRequiredDialogContent.vue +++ b/src/platform/cloud/subscription/components/SubscriptionRequiredDialogContent.vue @@ -214,12 +214,19 @@ const startPolling = () => { }, POLL_INTERVAL_MS) } +const handleWindowFocus = () => { + if (showCustomPricingTable.value) { + startPolling() + } +} + watch( showCustomPricingTable, (enabled) => { if (enabled) { - startPolling() + window.addEventListener('focus', handleWindowFocus) } else { + window.removeEventListener('focus', handleWindowFocus) stopPolling() } }, @@ -264,6 +271,7 @@ const handleViewEnterprise = () => { onBeforeUnmount(() => { stopPolling() + window.removeEventListener('focus', handleWindowFocus) })