mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-19 06:30:10 +08:00
fix(AssistantPresetCard): update group handling to use isArray for better type safety
This commit is contained in:
parent
03db02d5f7
commit
880673c4eb
@ -7,6 +7,7 @@ import type { AssistantPreset } from '@renderer/types'
|
||||
import { getLeadingEmoji } from '@renderer/utils'
|
||||
import { Button, Dropdown } from 'antd'
|
||||
import { t } from 'i18next'
|
||||
import { isArray } from 'lodash'
|
||||
import { ArrowDownAZ, Ellipsis, PlusIcon, SquareArrowOutUpRight } from 'lucide-react'
|
||||
import { type FC, memo, useCallback, useEffect, useRef, useState } from 'react'
|
||||
import styled from 'styled-components'
|
||||
@ -142,7 +143,7 @@ const AssistantPresetCard: FC<Props> = ({ preset, onClick, activegroup, getLocal
|
||||
{getLocalizedGroupName('我的')}
|
||||
</CustomTag>
|
||||
)}
|
||||
{!!preset.group?.length &&
|
||||
{isArray(preset.group) &&
|
||||
preset.group.map((group) => (
|
||||
<CustomTag key={group} color="#A0A0A0" size={11}>
|
||||
{getLocalizedGroupName(group)}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user