Fix host value in connect UI when RR + transaction pooler selected (#42242)

This commit is contained in:
Joshen Lim authored and GitHub committed 2026-01-28 21:14:04 +08:00
1 parent 6714805612
commit f6441d8d60
1 file changed
+10 -5
@@ -1,7 +1,3 @@
import { BookOpen, ChevronDown, ExternalLink } from 'lucide-react'
import { parseAsString, useQueryState } from 'nuqs'
import { HTMLAttributes, ReactNode, useEffect, useMemo, useState } from 'react'
import { useParams } from 'common'
import { getAddons } from 'components/interfaces/Billing/Subscription/Subscription.utils'
import AlertError from 'components/ui/AlertError'
@@ -15,6 +11,9 @@ import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { DOCS_URL, IS_PLATFORM } from 'lib/constants'
import { pluckObjectFields } from 'lib/helpers'
import { BookOpen, ChevronDown, ExternalLink } from 'lucide-react'
import { parseAsString, useQueryState } from 'nuqs'
import { HTMLAttributes, ReactNode, useEffect, useMemo, useState } from 'react'
import { useDatabaseSelectorStateSnapshot } from 'state/database-selector'
import {
Badge,
@@ -33,6 +32,7 @@ import {
cn,
} from 'ui'
import { ShimmeringLoader } from 'ui-patterns/ShimmeringLoader'
import {
CONNECTION_PARAMETERS,
type ConnectionStringMethod,
@@ -462,7 +462,12 @@ export const DatabaseConnectionString = () => {
}}
notice={['Does not support PREPARE statements']}
parameters={[
{ ...CONNECTION_PARAMETERS.host, value: poolingConfiguration?.db_host ?? '' },
{
...CONNECTION_PARAMETERS.host,
value: isReplicaSelected
? connectionInfo.db_host
: poolingConfiguration?.db_host ?? '',
},
{
...CONNECTION_PARAMETERS.port,
value: poolingConfiguration?.db_port.toString() ?? '6543',