@@ -4,7 +4,7 @@ import { createSharedComposable } from '@vueuse/core'
44import { useCurrentUser } from '@/composables/auth/useCurrentUser'
55import { useFirebaseAuthActions } from '@/composables/auth/useFirebaseAuthActions'
66import { useErrorHandling } from '@/composables/useErrorHandling'
7- import { COMFY_API_BASE_URL } from '@/config/comfyApi'
7+ import { getComfyApiBaseUrl , getComfyPlatformBaseUrl } from '@/config/comfyApi'
88import { MONTHLY_SUBSCRIPTION_PRICE } from '@/config/subscriptionPricesConfig'
99import { t } from '@/i18n'
1010import { isCloud } from '@/platform/distribution/types'
@@ -74,6 +74,8 @@ function useSubscriptionInternal() {
7474 ( ) => `$${ MONTHLY_SUBSCRIPTION_PRICE . toFixed ( 0 ) } `
7575 )
7676
77+ const buildApiUrl = ( path : string ) => `${ getComfyApiBaseUrl ( ) } ${ path } `
78+
7779 const fetchStatus = wrapWithErrorHandlingAsync (
7880 fetchSubscriptionStatus ,
7981 reportError
@@ -114,7 +116,7 @@ function useSubscriptionInternal() {
114116 }
115117
116118 const handleViewUsageHistory = ( ) => {
117- window . open ( 'https://platform.comfy.org/ profile/usage' , '_blank' )
119+ window . open ( ` ${ getComfyPlatformBaseUrl ( ) } / profile/usage` , '_blank' )
118120 }
119121
120122 const handleLearnMore = ( ) => {
@@ -136,7 +138,7 @@ function useSubscriptionInternal() {
136138 }
137139
138140 const response = await fetch (
139- ` ${ COMFY_API_BASE_URL } /customers/cloud-subscription-status` ,
141+ buildApiUrl ( ' /customers/cloud-subscription-status' ) ,
140142 {
141143 headers : {
142144 ...authHeader ,
@@ -181,7 +183,7 @@ function useSubscriptionInternal() {
181183 }
182184
183185 const response = await fetch (
184- ` ${ COMFY_API_BASE_URL } /customers/cloud-subscription-checkout` ,
186+ buildApiUrl ( ' /customers/cloud-subscription-checkout' ) ,
185187 {
186188 method : 'POST' ,
187189 headers : {
0 commit comments