Skip to content

Commit 543fe32

Browse files
committed
Remove conditional rendering of the Anthropic extended cache setting
- remove check for [Fragment]
1 parent ebf2bf8 commit 543fe32

1 file changed

Lines changed: 15 additions & 21 deletions

File tree

  • apps/editor/src/views/settings/frontend/Home

‎apps/editor/src/views/settings/frontend/Home/Home.tsx‎

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState, useRef, useEffect, useCallback, useMemo } from 'react'
1+
import { useState, useRef, useEffect, useCallback } from 'react'
22
import { Layout as UiLayout } from '@ui/components/editor/settings/Layout'
33
import { NavigationItem as UiNavigationItem } from '@ui/components/editor/settings/NavigationItem'
44
import { ModelProvidersSection } from './sections/ModelProvidersSection'
@@ -183,10 +183,6 @@ export const Home: React.FC<Props> = (props) => {
183183
useState('')
184184
const [stuck_sections, set_stuck_sections] = useState(new Set<NavItem>())
185185

186-
const has_anthropic_provider = useMemo(() => {
187-
return props.providers.some((p) => p.name == 'Anthropic')
188-
}, [props.providers])
189-
190186
const handle_stuck_change = useCallback((id: NavItem, is_stuck: boolean) => {
191187
set_stuck_sections((prev) => {
192188
const is_currently_stuck = prev.has(id)
@@ -426,22 +422,20 @@ export const Home: React.FC<Props> = (props) => {
426422
on_edit_provider={props.on_edit_provider}
427423
on_change_api_key={props.on_change_api_key}
428424
/>
429-
{has_anthropic_provider && (
430-
<UiItem
431-
title={t('model-providers.extended-cache.anthropic.title')}
432-
description={t(
433-
'model-providers.extended-cache.anthropic.description'
434-
)}
435-
slot_right={
436-
<UiToggler
437-
is_on={props.extended_cache_duration_for_anthropic}
438-
on_toggle={
439-
props.on_extended_cache_duration_for_anthropic_change
440-
}
441-
/>
442-
}
443-
/>
444-
)}
425+
<UiItem
426+
title={t('model-providers.extended-cache.anthropic.title')}
427+
description={t(
428+
'model-providers.extended-cache.anthropic.description'
429+
)}
430+
slot_right={
431+
<UiToggler
432+
is_on={props.extended_cache_duration_for_anthropic}
433+
on_toggle={
434+
props.on_extended_cache_duration_for_anthropic_change
435+
}
436+
/>
437+
}
438+
/>
445439
</UiGroup>
446440
</UiSection>
447441
<UiSection

0 commit comments

Comments
 (0)