diff --git a/web/app/(commonLayout)/deployments/page.tsx b/web/app/(commonLayout)/deployments/page.tsx index 585f4bb03e..f6bff9762d 100644 --- a/web/app/(commonLayout)/deployments/page.tsx +++ b/web/app/(commonLayout)/deployments/page.tsx @@ -1,5 +1,4 @@ 'use client' -import * as React from 'react' import { useTranslation } from 'react-i18next' import DeploymentsMain from '@/features/deployments/list' import useDocumentTitle from '@/hooks/use-document-title' @@ -10,4 +9,4 @@ const DeploymentsPage = () => { return } -export default React.memo(DeploymentsPage) +export default DeploymentsPage diff --git a/web/features/deployments/components/create-instance-modal.tsx b/web/features/deployments/components/create-instance-modal.tsx index 657805da57..69dc54d95c 100644 --- a/web/features/deployments/components/create-instance-modal.tsx +++ b/web/features/deployments/components/create-instance-modal.tsx @@ -7,7 +7,6 @@ import { cn } from '@langgenius/dify-ui/cn' import { Dialog, DialogCloseButton, DialogContent, DialogDescription, DialogTitle } from '@langgenius/dify-ui/dialog' import { Popover, PopoverContent, PopoverTrigger } from '@langgenius/dify-ui/popover' import { toast } from '@langgenius/dify-ui/toast' -import * as React from 'react' import { useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' import { AppTypeIcon } from '@/app/components/app/type-selector' @@ -46,8 +45,6 @@ export const AppPicker: FC = ({ apps, isLoading, value, onChange const triggerRef = useRef(null) const [triggerWidth, setTriggerWidth] = useState(undefined) - const selected = useMemo(() => apps.find(a => a.id === value), [apps, value]) - const filtered = useMemo(() => { const q = keywords.trim().toLowerCase() if (!q) @@ -71,6 +68,8 @@ export const AppPicker: FC = ({ apps, isLoading, value, onChange ) } + const selected = apps.find(a => a.id === value) + if (apps.length === 0) { return (
diff --git a/web/features/deployments/components/deploy-drawer/select.tsx b/web/features/deployments/components/deploy-drawer/select.tsx index 2abc834c73..aeafaf08a3 100644 --- a/web/features/deployments/components/deploy-drawer/select.tsx +++ b/web/features/deployments/components/deploy-drawer/select.tsx @@ -4,7 +4,6 @@ import type { FC } from 'react' import type { EnvironmentOption } from '@/contract/console/deployments' import { cn } from '@langgenius/dify-ui/cn' import { Select, SelectContent, SelectItem, SelectItemIndicator, SelectItemText, SelectTrigger } from '@langgenius/dify-ui/select' -import { useMemo } from 'react' import { useTranslation } from 'react-i18next' import { environmentHealth, environmentMode, environmentName } from '../../utils' import { HealthBadge, ModeBadge } from '../status-badge' @@ -36,10 +35,7 @@ type SelectProps = { export const DeploymentSelect: FC = ({ value, onChange, options, placeholder }) => { const { t } = useTranslation('deployments') - const selectedOption = useMemo( - () => options.find(option => option.value === value), - [options, value], - ) + const selectedOption = options.find(option => option.value === value) return (