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
This commit is contained in:
bymyself
2025-12-11 01:10:30 -08:00
parent 8b7194e073
commit d3afe2b292
2 changed files with 10 additions and 2 deletions

View File

@@ -145,7 +145,7 @@ const TIER_TO_KEY: Record<SubscriptionTier, TierKey> = {
STANDARD: 'standard', STANDARD: 'standard',
CREATOR: 'creator', CREATOR: 'creator',
PRO: 'pro', PRO: 'pro',
FOUNDERS_EDITION: 'creator' FOUNDERS_EDITION: 'standard'
} }
const tiers: PricingTierConfig[] = [ const tiers: PricingTierConfig[] = [

View File

@@ -214,12 +214,19 @@ const startPolling = () => {
}, POLL_INTERVAL_MS) }, POLL_INTERVAL_MS)
} }
const handleWindowFocus = () => {
if (showCustomPricingTable.value) {
startPolling()
}
}
watch( watch(
showCustomPricingTable, showCustomPricingTable,
(enabled) => { (enabled) => {
if (enabled) { if (enabled) {
startPolling() window.addEventListener('focus', handleWindowFocus)
} else { } else {
window.removeEventListener('focus', handleWindowFocus)
stopPolling() stopPolling()
} }
}, },
@@ -264,6 +271,7 @@ const handleViewEnterprise = () => {
onBeforeUnmount(() => { onBeforeUnmount(() => {
stopPolling() stopPolling()
window.removeEventListener('focus', handleWindowFocus)
}) })
</script> </script>