mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
fix(ff): add back condition for isHosted FF (#2789)
* fix(ff): add back condition for isHosted FF * updated callers to use getBaseUrl()
This commit is contained in:
+2
-2
@@ -23,7 +23,7 @@ import { Alert, AlertDescription, Skeleton } from '@/components/ui'
|
||||
import { getEnv, isTruthy } from '@/lib/core/config/env'
|
||||
import { generatePassword } from '@/lib/core/security/encryption'
|
||||
import { cn } from '@/lib/core/utils/cn'
|
||||
import { getEmailDomain } from '@/lib/core/utils/urls'
|
||||
import { getBaseUrl, getEmailDomain } from '@/lib/core/utils/urls'
|
||||
import { quickValidateEmail } from '@/lib/messaging/email/validation'
|
||||
import { OutputSelect } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/chat/components/output-select/output-select'
|
||||
import {
|
||||
@@ -493,7 +493,7 @@ function IdentifierInput({
|
||||
onChange(lowercaseValue)
|
||||
}
|
||||
|
||||
const fullUrl = `${getEnv('NEXT_PUBLIC_APP_URL')}/chat/${value}`
|
||||
const fullUrl = `${getBaseUrl()}/chat/${value}`
|
||||
const displayUrl = fullUrl.replace(/^https?:\/\//, '')
|
||||
|
||||
return (
|
||||
|
||||
+1
-2
@@ -14,7 +14,6 @@ import {
|
||||
Tooltip,
|
||||
} from '@/components/emcn'
|
||||
import { Skeleton } from '@/components/ui'
|
||||
import { getEnv } from '@/lib/core/config/env'
|
||||
import { isDev } from '@/lib/core/config/feature-flags'
|
||||
import { cn } from '@/lib/core/utils/cn'
|
||||
import { getBaseUrl, getEmailDomain } from '@/lib/core/utils/urls'
|
||||
@@ -392,7 +391,7 @@ export function FormDeploy({
|
||||
)
|
||||
}
|
||||
|
||||
const fullUrl = `${getEnv('NEXT_PUBLIC_APP_URL')}/form/${identifier}`
|
||||
const fullUrl = `${getBaseUrl()}/form/${identifier}`
|
||||
const displayUrl = fullUrl.replace(/^https?:\/\//, '')
|
||||
|
||||
return (
|
||||
|
||||
+5
-5
@@ -15,7 +15,7 @@ import {
|
||||
ModalTabsList,
|
||||
ModalTabsTrigger,
|
||||
} from '@/components/emcn'
|
||||
import { getEnv } from '@/lib/core/config/env'
|
||||
import { getBaseUrl } from '@/lib/core/utils/urls'
|
||||
import { getInputFormatExample as getInputFormatExampleUtil } from '@/lib/workflows/operations/deployment-utils'
|
||||
import type { WorkflowDeploymentVersionResponse } from '@/lib/workflows/persistence/utils'
|
||||
import { useUserPermissionsContext } from '@/app/workspace/[workspaceId]/providers/workspace-permissions-provider'
|
||||
@@ -209,7 +209,7 @@ export function DeployModal({
|
||||
}
|
||||
|
||||
const data = await response.json()
|
||||
const endpoint = `${getEnv('NEXT_PUBLIC_APP_URL')}/api/workflows/${workflowId}/execute`
|
||||
const endpoint = `${getBaseUrl()}/api/workflows/${workflowId}/execute`
|
||||
const inputFormatExample = getInputFormatExample(selectedStreamingOutputs.length > 0)
|
||||
const placeholderKey = workflowWorkspaceId ? 'YOUR_WORKSPACE_API_KEY' : 'YOUR_API_KEY'
|
||||
|
||||
@@ -270,7 +270,7 @@ export function DeployModal({
|
||||
const deploymentInfoResponse = await fetch(`/api/workflows/${workflowId}/deploy`)
|
||||
if (deploymentInfoResponse.ok) {
|
||||
const deploymentData = await deploymentInfoResponse.json()
|
||||
const apiEndpoint = `${getEnv('NEXT_PUBLIC_APP_URL')}/api/workflows/${workflowId}/execute`
|
||||
const apiEndpoint = `${getBaseUrl()}/api/workflows/${workflowId}/execute`
|
||||
const inputFormatExample = getInputFormatExample(selectedStreamingOutputs.length > 0)
|
||||
const placeholderKey = getApiHeaderPlaceholder()
|
||||
|
||||
@@ -409,7 +409,7 @@ export function DeployModal({
|
||||
const deploymentInfoResponse = await fetch(`/api/workflows/${workflowId}/deploy`)
|
||||
if (deploymentInfoResponse.ok) {
|
||||
const deploymentData = await deploymentInfoResponse.json()
|
||||
const apiEndpoint = `${getEnv('NEXT_PUBLIC_APP_URL')}/api/workflows/${workflowId}/execute`
|
||||
const apiEndpoint = `${getBaseUrl()}/api/workflows/${workflowId}/execute`
|
||||
const inputFormatExample = getInputFormatExample(selectedStreamingOutputs.length > 0)
|
||||
const placeholderKey = getApiHeaderPlaceholder()
|
||||
|
||||
@@ -526,7 +526,7 @@ export function DeployModal({
|
||||
const deploymentInfoResponse = await fetch(`/api/workflows/${workflowId}/deploy`)
|
||||
if (deploymentInfoResponse.ok) {
|
||||
const deploymentData = await deploymentInfoResponse.json()
|
||||
const apiEndpoint = `${getEnv('NEXT_PUBLIC_APP_URL')}/api/workflows/${workflowId}/execute`
|
||||
const apiEndpoint = `${getBaseUrl()}/api/workflows/${workflowId}/execute`
|
||||
const inputFormatExample = getInputFormatExample(selectedStreamingOutputs.length > 0)
|
||||
|
||||
const placeholderKey = getApiHeaderPlaceholder()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Environment utility functions for consistent environment detection across the application
|
||||
*/
|
||||
import { env, isFalsy, isTruthy } from './env'
|
||||
import { env, getEnv, isFalsy, isTruthy } from './env'
|
||||
|
||||
/**
|
||||
* Is the application running in production mode
|
||||
@@ -21,7 +21,9 @@ export const isTest = env.NODE_ENV === 'test'
|
||||
/**
|
||||
* Is this the hosted version of the application
|
||||
*/
|
||||
export const isHosted = true
|
||||
export const isHosted =
|
||||
getEnv('NEXT_PUBLIC_APP_URL') === 'https://www.sim.ai' ||
|
||||
getEnv('NEXT_PUBLIC_APP_URL') === 'https://www.staging.sim.ai'
|
||||
|
||||
/**
|
||||
* Is billing enforcement enabled
|
||||
|
||||
Reference in New Issue
Block a user