mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 03:01:54 +00:00
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:
@@ -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[] = [
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user