mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 10:40:07 +08:00
refactor: remove unused error handling alerts from AssistantsTab component
This commit is contained in:
parent
9b9640d8d1
commit
251c269ab3
@ -7,10 +7,7 @@ import { useRuntime } from '@renderer/hooks/useRuntime'
|
|||||||
import { useAssistantsTabSortType } from '@renderer/hooks/useStore'
|
import { useAssistantsTabSortType } from '@renderer/hooks/useStore'
|
||||||
import { useTags } from '@renderer/hooks/useTags'
|
import { useTags } from '@renderer/hooks/useTags'
|
||||||
import { useAppDispatch } from '@renderer/store'
|
import { useAppDispatch } from '@renderer/store'
|
||||||
import { addIknowAction } from '@renderer/store/runtime'
|
|
||||||
import type { Assistant, AssistantsSortType, Topic } from '@renderer/types'
|
import type { Assistant, AssistantsSortType, Topic } from '@renderer/types'
|
||||||
import { getErrorMessage } from '@renderer/utils'
|
|
||||||
import { Alert } from 'antd'
|
|
||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import { useCallback, useRef, useState } from 'react'
|
import { useCallback, useRef, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
@ -126,29 +123,6 @@ const AssistantsTab: FC<AssistantsTabProps> = (props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Container className="assistants-tab" ref={containerRef}>
|
<Container className="assistants-tab" ref={containerRef}>
|
||||||
{!apiServerConfig.enabled && !apiServerRunning && !iknow[ALERT_KEY] && (
|
|
||||||
<Alert
|
|
||||||
type="warning"
|
|
||||||
message={t('agent.warning.enable_server')}
|
|
||||||
closable
|
|
||||||
onClose={() => dispatch(addIknowAction(ALERT_KEY))}
|
|
||||||
style={{ marginBottom: 10 }}
|
|
||||||
showIcon
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{apiServerConfig.enabled && !apiServerLoading && !apiServerRunning && (
|
|
||||||
<Alert type="error" message={t('agent.server.error.not_running')} closable className="mb-2" showIcon />
|
|
||||||
)}
|
|
||||||
{apiServerRunning && agentsError && (
|
|
||||||
<Alert
|
|
||||||
type="error"
|
|
||||||
message={t('agent.list.error.failed')}
|
|
||||||
description={getErrorMessage(agentsError)}
|
|
||||||
className="mb-2"
|
|
||||||
showIcon
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<UnifiedAddButton
|
<UnifiedAddButton
|
||||||
onCreateAssistant={onCreateAssistant}
|
onCreateAssistant={onCreateAssistant}
|
||||||
setActiveAssistant={setActiveAssistant}
|
setActiveAssistant={setActiveAssistant}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user