diff --git a/src/components/dialog/content/setting/LegacyCreditsPanel.vue b/src/components/dialog/content/setting/LegacyCreditsPanel.vue index e5bddcaa6..9055f3972 100644 --- a/src/components/dialog/content/setting/LegacyCreditsPanel.vue +++ b/src/components/dialog/content/setting/LegacyCreditsPanel.vue @@ -139,7 +139,7 @@ interface CreditHistoryItemData { isPositive: boolean } -const { buildDocsUrl } = useExternalLink() +const { buildDocsUrl, docsPaths } = useExternalLink() const dialogService = useDialogService() const authStore = useFirebaseAuthStore() const authActions = useFirebaseAuthActions() @@ -194,9 +194,7 @@ const handleFaqClick = () => { const handleOpenPartnerNodesInfo = () => { window.open( - buildDocsUrl('/tutorials/api-nodes/overview#api-nodes', { - includeLocale: true - }), + buildDocsUrl(docsPaths.partnerNodesPricing, { includeLocale: true }), '_blank' ) } diff --git a/src/components/topbar/CurrentUserPopover.test.ts b/src/components/topbar/CurrentUserPopover.test.ts index f46ae0990..cb2efd7b7 100644 --- a/src/components/topbar/CurrentUserPopover.test.ts +++ b/src/components/topbar/CurrentUserPopover.test.ts @@ -131,7 +131,10 @@ vi.mock('@/base/credits/comfyCredits', () => ({ // Mock useExternalLink vi.mock('@/composables/useExternalLink', () => ({ useExternalLink: vi.fn(() => ({ - buildDocsUrl: vi.fn((path) => `https://docs.comfy.org${path}`) + buildDocsUrl: vi.fn((path) => `https://docs.comfy.org${path}`), + docsPaths: { + partnerNodesPricing: '/tutorials/partner-nodes/pricing' + } })) })) diff --git a/src/components/topbar/CurrentUserPopover.vue b/src/components/topbar/CurrentUserPopover.vue index e2630c5be..af1a3ed08 100644 --- a/src/components/topbar/CurrentUserPopover.vue +++ b/src/components/topbar/CurrentUserPopover.vue @@ -160,7 +160,7 @@ const emit = defineEmits<{ close: [] }>() -const { buildDocsUrl } = useExternalLink() +const { buildDocsUrl, docsPaths } = useExternalLink() const { userDisplayName, userEmail, userPhotoUrl, handleSignOut } = useCurrentUser() @@ -224,9 +224,7 @@ const handleTopUp = () => { const handleOpenPartnerNodesInfo = () => { window.open( - buildDocsUrl('/tutorials/partner-nodes/pricing', { - includeLocale: true - }), + buildDocsUrl(docsPaths.partnerNodesPricing, { includeLocale: true }), '_blank' ) emit('close') diff --git a/src/composables/useExternalLink.ts b/src/composables/useExternalLink.ts index 2758e2ced..75cb07454 100644 --- a/src/composables/useExternalLink.ts +++ b/src/composables/useExternalLink.ts @@ -92,8 +92,14 @@ export function useExternalLink() { comfyOrg: 'https://www.comfy.org/' } + /** Common doc paths for use with buildDocsUrl */ + const docsPaths = { + partnerNodesPricing: '/tutorials/partner-nodes/pricing' + } + return { buildDocsUrl, - staticUrls + staticUrls, + docsPaths } } diff --git a/src/platform/cloud/subscription/components/SubscriptionPanel.vue b/src/platform/cloud/subscription/components/SubscriptionPanel.vue index 49fbb103c..60032de8b 100644 --- a/src/platform/cloud/subscription/components/SubscriptionPanel.vue +++ b/src/platform/cloud/subscription/components/SubscriptionPanel.vue @@ -378,7 +378,7 @@ type TierKey = (typeof TIER_TO_I18N_KEY)[SubscriptionTier] const DEFAULT_TIER_KEY: TierKey = 'standard' -const { buildDocsUrl } = useExternalLink() +const { buildDocsUrl, docsPaths } = useExternalLink() const authActions = useFirebaseAuthActions() const { t } = useI18n() @@ -469,9 +469,7 @@ const { const handleOpenPartnerNodesInfo = () => { window.open( - buildDocsUrl('/tutorials/api-nodes/overview#api-nodes', { - includeLocale: true - }), + buildDocsUrl(docsPaths.partnerNodesPricing, { includeLocale: true }), '_blank' ) }